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.335.tar.gz
(14.0 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.335.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b91cde18968cda97e4e8fb7a05c8e545b3cdc89ae0b775cf8f5a11ae4922d02 |
|
MD5 | 104a4fec9c6052fc46f235c7224832dc |
|
BLAKE2b-256 | 2916a39e02d908e5d0d258fa2a131fca73aaffd43cc1a8bb43a1f5cfc706f0a0 |
Close
Hashes for cdk_cr_constructs-2.1.335-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18f85262925525ddc87b551a9238d977ce9bdf6f7ff0bedd36245f0dae0ef49e |
|
MD5 | ce599a1110b3115fd24bd303201987c5 |
|
BLAKE2b-256 | 1dd41d76ebbb0b30d878790ea201edc646564bee2e40c74cf49c49692eedfcee |