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.370.tar.gz
(14.9 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.370.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78aee761a813395ab20c20527f930e45921234ad41d9e95a3978998aee4a3dcf |
|
MD5 | 7edc8c91ec512f46d0ccea541d863211 |
|
BLAKE2b-256 | df9030c848814d1d8b5a8979bd4447996d8df84f5f502520fdf8fe753a577ed6 |
Close
Hashes for cdk_cr_constructs-2.1.370-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f95392bf268dfcebf9c55380979aa57f42d4817915c401d4fd8b217a7548b692 |
|
MD5 | a1b7f4eaa58f84c720349bc5ea007886 |
|
BLAKE2b-256 | 0a4da7731f98fa17d8e17fb965e175e6d9ae8ccf6a60e7326d296697e98c864f |