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.589.tar.gz
(15.5 MB
view hashes)
Built Distribution
Close
Hashes for cdk_cr_constructs-2.1.589.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4463252d711ad6702925a00c94bfa94ebb1d5ae3f9f7adf33241e3f9e320057b |
|
MD5 | 800c93b30c5ff47df4289c5d7e756390 |
|
BLAKE2b-256 | 2a924c55b37d5a51b2156c49d8de8fbda2a86db2ae1d379a4e7fee5c7c898eba |
Close
Hashes for cdk_cr_constructs-2.1.589-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f51763341fb33ddf081b9d427d912d977cd98ea037d916fd7a6f5e9faeb57eef |
|
MD5 | 00bfd131f6fd505b02416a8ac32c4cbd |
|
BLAKE2b-256 | 3d9f873df364abeea56c02d87f1e817e48e78d31b76b4c9a168fea5de876d9e0 |