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.337.tar.gz
(13.9 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.337.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cea5c46d9a7a47d510bd3a965fc94b74889e370efd9143e9b465ba6f8ba1948d |
|
MD5 | 31c8fdb2e1afea13d320b2e14c87efe7 |
|
BLAKE2b-256 | b9adc6f85a53be80a1069feef07fff21d617bb3f7f25f94104169a35f2b5f804 |
Close
Hashes for cdk_cr_constructs-2.1.337-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3305879d9f9f5c84022e43c991338dd728fe1aed12be43f23d7e66d95e67fbe |
|
MD5 | 89f30dd97b28d61ee1e356911b31fa79 |
|
BLAKE2b-256 | 436903a8b4f04b5d0c92cb09ea42652cf7f6eba71fda4713d6575c8c453cd0a0 |