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.588.tar.gz
(15.5 MB
view hashes)
Built Distribution
Close
Hashes for cdk_cr_constructs-2.1.588.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32c5bec0c322c69d0c3994023d5c97d32ec29fac6dc49ab198344e4de5ff8d3e |
|
MD5 | 2e5619ab5018dda852c297bc2dccfa2a |
|
BLAKE2b-256 | 18854c2937a3cab625a1c0e4ab32255bc906abeff4e67764b9009d1318019588 |
Close
Hashes for cdk_cr_constructs-2.1.588-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ede3bd1898dcf76538273eb8f035236896d172e136b2f30dc7348847d359fb66 |
|
MD5 | f879e9af6def9401d5aacfa22ad008de |
|
BLAKE2b-256 | e4a21a891d362929a1d341251298973f8a92b62c7597bf1d4bb88a2f946abae2 |