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.334.tar.gz
(14.0 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.334.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcdfb068da959cccb549f7282e697a8712e7822271c9b2c48bf241473b3fbb12 |
|
MD5 | 71bbfdad965105aeec39963811359f6c |
|
BLAKE2b-256 | 59fbd1300e8d0904d6788443895bfac3a9b576212ca608d3cadae9d34d0819f3 |
Close
Hashes for cdk_cr_constructs-2.1.334-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5298c4ad785a9ab3701259c53397e63c5ec145102ee2ef28a7873a37e94470a |
|
MD5 | bb1dd6e4554bb92a072bfe0ce3a89045 |
|
BLAKE2b-256 | 3e46f57f611ee3ef71d61112e87eb1797b3e48e0776b405389efaaec3676a34d |