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.359.tar.gz
(14.9 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.359.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99e57ccbe295c99c78b802277ddfff0e2918c2639437846ab5cc3069c4e06bf7 |
|
MD5 | f45b98ed6d9ceba59b4f4cb793623bf9 |
|
BLAKE2b-256 | 8344166d92c11a658ee6a11d272dd439be7dc7474d1ec02e7b5f7d0dc6a0a2cf |
Close
Hashes for cdk_cr_constructs-2.1.359-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b5dde4240884e6750cd43c9a23593b36630d61901b6d4adaea2cf5563877fd2 |
|
MD5 | 703feea5af380d5258e27ee8a542845a |
|
BLAKE2b-256 | dd383e98107c82c920d356d61b24f9789d949956da68dd670fbac2a118b62af2 |