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.404.tar.gz
(15.0 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.404.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34678bbe3d66cd47480547acce980c13c2b6d4151ba153b762acd8a8f5712f1a |
|
MD5 | 07577cd5cda3f7941656446a08fd32f4 |
|
BLAKE2b-256 | a5be2a20e5d0700cc7036eda129223705305062f3a2b5da74341a44bf978a5e6 |
Close
Hashes for cdk_cr_constructs-2.1.404-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdc5c974ee8b26094a83da3c26429f61de87a1cb81228edf54ca2ca73f034fb5 |
|
MD5 | a6872f7ccf7271152ce55b67b74d3542 |
|
BLAKE2b-256 | 933f488857b59af5478631a053b3d28f016ce321e53da42a5f9314575fd08487 |