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.466.tar.gz
(15.1 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.466.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ba2e5d71eef47f20373792251225a202bf690a8f23a48e1910cbf2b721d3cdd |
|
MD5 | 63c0e2f4556f27c3abc3831d0611b013 |
|
BLAKE2b-256 | 90df76078f96d1e00dbac3dc04e658af7ba2c2119e91bcb081356501c43e34cb |
Close
Hashes for cdk_cr_constructs-2.1.466-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d2a141b72a4eaa3fcbc111c6297da9d0ed8004f1ed4102d61fef0cf450c77e5 |
|
MD5 | db1a5d845c4caa9f2d971be254f244b2 |
|
BLAKE2b-256 | d861b5f9ffa9520d66a9ee3f8f871b7ee9f5be7d604beb05cb1c28b2c965564c |