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.388.tar.gz
(15.0 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.388.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ce67a00b074fcf09d7059e2b21ae072c29e3cf85f52bbaf435586b95c1b1d95 |
|
MD5 | dc52913df6ab3d7eaf3d750f9c3105e0 |
|
BLAKE2b-256 | b28dbcace884fd7eb048b8cbd599c99067e5c3277f02fd93061b0aabb82f9506 |
Close
Hashes for cdk_cr_constructs-2.1.388-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ae01d0e32b9d47733d907bb74a913492fff73550b76cfb19aa23a52065b7f50 |
|
MD5 | c7754a56d3c274a76b3c7f6395b0fb5f |
|
BLAKE2b-256 | 49aa148e8cfbd39b55c71bfdf0a1890ab520b9de189efceef1f742be834702f3 |