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.485.tar.gz
(15.2 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.485.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d46c6dc31f412b358211bd2e99c0b896f24aa38ffdd856be037d7eef0306707 |
|
MD5 | 6cc6773eeba1a50155ce10ddea5b9741 |
|
BLAKE2b-256 | 35fb5e0ade212cfd6e4b576a6e209d096b5207d71d18f7611bfd35733ea51bc2 |
Close
Hashes for cdk_cr_constructs-2.1.485-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f00e5cae467496cb943f029d31b7eabdecebb65dc6236936c68fde2a8405ff7 |
|
MD5 | 9fc48eaa782594606bc419de622b8dea |
|
BLAKE2b-256 | 9d370ba657f0317e2b21e8a9b299079f02b843bb25968b6367acb6df8b4c6571 |