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.345.tar.gz
(14.0 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.345.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4ede623ed1c30519d443cb2fcc2be06786a2a723bd8b793cb4e4bddaf8e3f08 |
|
MD5 | eab1b24447ba84ae7c8edea253cc6292 |
|
BLAKE2b-256 | 43117c2de0f3d0f93c8c8843ff0749a651a65b5bd5ccf762e3c254016e812e9c |
Close
Hashes for cdk_cr_constructs-2.1.345-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6256c18dbe1c6fd585bf1b2cd53ece1b32e34a6f6a3a0ab514a87f354daf8074 |
|
MD5 | 27273a2d241498e137d7c866f52315b5 |
|
BLAKE2b-256 | d9336a38257bf84f113cc6234e91e920ac2d168d6e9d708807c5f0bb23c35f6c |