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.553.tar.gz
(15.4 MB
view hashes)
Built Distribution
Close
Hashes for cdk_cr_constructs-2.1.553.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f66b535b39f127ca56d07a744344bc838caa2cdaed48477107bd5f148d939f0 |
|
MD5 | 099ae6a6165219428db71ad44beeaa90 |
|
BLAKE2b-256 | 599936186a55b3d575783b1648c485c6f1bcbf33b9d74ca53670216965d0509e |
Close
Hashes for cdk_cr_constructs-2.1.553-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f88370cbec1c1ba948ea090b73205362b0c52bcea9269a6d26768a4ec9ef65b8 |
|
MD5 | 889cb16e6a2d61a0ccda5fc14a9dcd08 |
|
BLAKE2b-256 | 05522f5f9d281e5eac8a8fa27bd39f146261c2723bbfc0bf65c22cc9d171987c |