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.471.tar.gz
(15.1 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.471.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f18d879d0f7ed5b95bd4b94f553b096754987b15eab29aa273ee15adf39b196 |
|
MD5 | c5f5a9d9d9ba86980015697598012a75 |
|
BLAKE2b-256 | 52d29696b85f5ab23383b2bbcf916a34338ab659b3ebe951198bc60b35f7eae0 |
Close
Hashes for cdk_cr_constructs-2.1.471-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89a0c8733ee573349de976c4c1f484da397c78d9521163d1919d57f763f9240e |
|
MD5 | d4d321d4ca9d63763b8ec9f2646cab82 |
|
BLAKE2b-256 | c479bb57cba8e290d50623823af3626db77bb8ab946302e7371e2db219e9a704 |