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.426.tar.gz
(15.1 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.426.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 167803f464e16e432d0e47c3cb356846dfbebbbd5483103b56899c786cebb3b1 |
|
MD5 | f80c2eedb8ce1251e1441435d17b2de9 |
|
BLAKE2b-256 | 6e8eb815d8b79e53a6df52a30beb3b46e2181e626c4c2274109301e67fb62a1d |
Close
Hashes for cdk_cr_constructs-2.1.426-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 746caa751fd0898c68ed9580461bdfd78d7408b006891a314449a84d671699da |
|
MD5 | 88416cf8d323d3cd0256e6d8706ff64f |
|
BLAKE2b-256 | 7a5a48882ad565fb34d3543cefec15d6d787269f6e8e1b433195c0f400f33b5d |