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.437.tar.gz
(15.2 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.437.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7330572ba5ead8b47c97ae257355214da5fc1e37f7863794f753d817bd28f3b2 |
|
MD5 | 08f6d0869688f1382a7f3ec6bc5079ab |
|
BLAKE2b-256 | 240d8282cfb0b206f3e31d10955bd43161561dcfa22775d673915ec9822d7202 |
Close
Hashes for cdk_cr_constructs-2.1.437-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 775d663ea2acb861fe2ab071bc4cdafc6e6dbeeedb14bf46e10773b7e43f2a34 |
|
MD5 | e36e2894eadef58e0b70a095a1c6e750 |
|
BLAKE2b-256 | e49ea8390ced08eab53903814a984a23bf152ae24699af2b88c017e2a960db6d |