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.548.tar.gz
(15.4 MB
view hashes)
Built Distribution
Close
Hashes for cdk_cr_constructs-2.1.548.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84877718eb4c6c765575b56622b6d83d2c20ef5cd70298d3cd5646b92e4c9604 |
|
MD5 | 4bdd1222a258c5d12af67bac4f5507e1 |
|
BLAKE2b-256 | 27ec69d0aa49cc858ae501a5beed730b07c4ce66df9acc1914f2b66f1c2c47e9 |
Close
Hashes for cdk_cr_constructs-2.1.548-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9197e0d9aa96637aff30f8572c0076aae0c4098ca5f5552daee867ae00d61d1 |
|
MD5 | 5e1de84560c7b777f9608286a0517e4a |
|
BLAKE2b-256 | 69495695b3a6fba44b8ea53467b8f017716c940b9868698b2026eca1253516e0 |