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.535.tar.gz
(15.4 MB
view hashes)
Built Distribution
Close
Hashes for cdk_cr_constructs-2.1.535.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7369a5d409848c739efcb96f8944a89f1f927e6ccd44ffb7ed9d9cdc2a431c2b |
|
MD5 | 0d9f1df575b2fb903fe85e72bb3995b9 |
|
BLAKE2b-256 | e52e9b70315eeba79b4bfa86294e521161480d25ba8a9be12b71194e2578bd84 |
Close
Hashes for cdk_cr_constructs-2.1.535-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a40a99284ccbf42eda7230674290e67403940f936fbf8fb4c03c3b7fcaf8de3 |
|
MD5 | 6c2f4b39e5ef1ef4040123380a56ea4d |
|
BLAKE2b-256 | 7457276c252a5e5bf6b3f2f41a8103cf5ec5150ca7d5876de1c204dc97988b5f |