aws cdk library for custom resource constructs.
Project description
cdk-cr-constructs
This Construct is collect custom resource
Example for CustomResourceGetEIP
import { App, Stack, CfnOutput, Duration, aws_iam } from 'aws-cdk-lib';
import { CustomResourceGetEIP } from 'cdk-cr-constructs';
const env = {
region: process.env.CDK_DEFAULT_REGION,
account: process.env.CDK_DEFAULT_ACCOUNT,
};
const app = new App();
const stack = new Stack(app, 'testing-stack', { env });
const getIps = new CustomResourceGetEIP(stack, 'CustomResourceGetEIP', {
/**
* Discovery us-east-1 Elastic Ips.
*/
regions: ['us-east-1'],
/**
* Add Company Ips.
*/
companyIps: ['1.2.3.4'],
});
const role = new aws_iam.Role(stack, 'DemoRole', {
assumedBy: new aws_iam.AccountRootPrincipal(),
});
/**
* Example create an assume role, allow all action from ip address.
*/
role.addToPolicy(new aws_iam.PolicyStatement({
effect: aws_iam.Effect.ALLOW,
resources: ['*'],
actions: ['*'],
conditions: {
IpAddress: {
'aws:SourceIp': getIps.ipList(),
},
},
}));
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cdk-cr-constructs-2.1.459.tar.gz
(15.1 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.459.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62fdfe6a40d4e1f3d07c8d256bfd7dd91e86b25916a270596581be1d46fde41a |
|
MD5 | e39f894e9d96ccd4f579af718d4a5eaa |
|
BLAKE2b-256 | 3feae342592c0ae41c3f0afb0b01fa3f6e8414293fb5eab459c1c89738113175 |
Close
Hashes for cdk_cr_constructs-2.1.459-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10991deeda87862a2b57439cf487a22f67443e08f35ca8d492c593f4381d144b |
|
MD5 | 8cfcf5cbd6bdaea37abdef4372166313 |
|
BLAKE2b-256 | 48654591fa079362df8c3563b1af63cc8313ab4b6a671c12055e8828a00dc311 |