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.491.tar.gz
(15.2 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.491.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86045e748a85a65b956b594d99973f701a8f82a6691bf12068ea12b139bb3204 |
|
MD5 | e9dba20a9abf009893e82bd5e547f358 |
|
BLAKE2b-256 | a2bd4ab5937a05e4b830d77197702e21da43b798293d73b9cf64b7d42b07f79b |
Close
Hashes for cdk_cr_constructs-2.1.491-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d49a2c117707a0d7d9f829359a3a42df1cfa2e649c7b1209d926348e62f064e2 |
|
MD5 | 508005991a7cae63fefd58840bb2cc29 |
|
BLAKE2b-256 | ac8b1a50dcb08528e5869280ee37bbb99dab5d9162180bcbb1591d5daabc9bc2 |