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.420.tar.gz
(15.1 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.420.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b66c5f7790002988f3ec0ef7b05a2ce96922ddb6a4af50a54cc63b2d7f710666 |
|
MD5 | 5f2cccfdde00be7c279effb80e973e7f |
|
BLAKE2b-256 | 2931b0bd1507b95d61f62570753778b6e9806aecc1377288c88918ddd60369ea |
Close
Hashes for cdk_cr_constructs-2.1.420-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38958a5a8fcf1e7815af59e296270104cfe18916f065cfa3a7f29016acd00b9f |
|
MD5 | f6c70232dec5e6df9aac28fed56ba4e8 |
|
BLAKE2b-256 | 06acee184d3a1e9e65ba95dfc424af29c692eefb31c17684904b3d1e3aa1f18b |