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.400.tar.gz
(15.0 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.400.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 550ab8e8f90b98b40424ef269e7fe353f68180f475678a84a7971f95cca9f082 |
|
MD5 | aa4fd098d66ee2d2daf8a0c7f5b405a8 |
|
BLAKE2b-256 | b8264d35a40d17636dde56b7f4dca948127c45eb67b4ecffef210fc396485efd |
Close
Hashes for cdk_cr_constructs-2.1.400-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 596dedf38fe9e9acc17119fdc6975decd13dffcc25cf3502c4e29f5f084141d1 |
|
MD5 | 490082967b6e7bc8ec87e339d9bbba65 |
|
BLAKE2b-256 | 20dc36fe2396a0a84bfdc0829b3ba4e279bbcb1196ef0df4a0e0213bb586664a |