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.468.tar.gz
(15.1 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.468.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e5337e82adf737acdc9437b8b778cd1daf96fad9f6ca51b1074903a4b30aca7 |
|
MD5 | 2761509bf0749fd5568473b5bbdcf24e |
|
BLAKE2b-256 | 5e7e605a63af0a331b503ba3969df2b01ff6b17a5b5acd062d75ca14f9945b6f |
Close
Hashes for cdk_cr_constructs-2.1.468-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 078cdc20a03506f68b110ad84a00e93db1e09d7d3be9979593659b31ee7e0343 |
|
MD5 | cb99498d199768433801fc4a0717f0aa |
|
BLAKE2b-256 | 33d1af7dfcd5819730bebbc981b03468874d08548cd6b3a309f6e804925cfc72 |