Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-cdk/aws-ec2

Package Overview
Dependencies
Maintainers
4
Versions
288
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-cdk/aws-ec2 - npm Package Compare versions

Comparing version 0.23.0 to 0.24.0

lib/ec2-augmentations.generated.d.ts

7

lib/connections.d.ts

@@ -75,3 +75,10 @@ import { ISecurityGroup } from "./security-group";

private readonly _securityGroupRules;
/**
* When doing bidirectional grants between Connections, make sure we don't recursive infinitely
*/
private skip;
/**
* When doing bidirectional grants between Security Groups in different stacks, put the rule on the other SG
*/
private remoteRule;
constructor(props?: ConnectionsProps);

@@ -78,0 +85,0 @@ readonly securityGroups: ISecurityGroup[];

35

lib/connections.js

@@ -28,3 +28,10 @@ "use strict";

this._securityGroupRules = new ReactiveList();
/**
* When doing bidirectional grants between Connections, make sure we don't recursive infinitely
*/
this.skip = false;
/**
* When doing bidirectional grants between Security Groups in different stacks, put the rule on the other SG
*/
this.remoteRule = false;
this.connections = this;

@@ -57,10 +64,17 @@ this._securityGroups.push(...(props.securityGroups || []));

}
const remoteRule = this.remoteRule; // Capture current value into local for callback to close over
this._securityGroups.forEachAndForever(securityGroup => {
other.connections._securityGroupRules.forEachAndForever(rule => {
securityGroup.addEgressRule(rule, portRange, description);
securityGroup.addEgressRule(rule, portRange, description, remoteRule);
});
});
this.skip = true;
other.connections.allowFrom(this, portRange, description);
this.skip = false;
other.connections.remoteRule = true;
try {
other.connections.allowFrom(this, portRange, description);
}
finally {
this.skip = false;
other.connections.remoteRule = false;
}
}

@@ -74,10 +88,17 @@ /**

}
const remoteRule = this.remoteRule; // Capture current value into local for callback to close over
this._securityGroups.forEachAndForever(securityGroup => {
other.connections._securityGroupRules.forEachAndForever(rule => {
securityGroup.addIngressRule(rule, portRange, description);
securityGroup.addIngressRule(rule, portRange, description, remoteRule);
});
});
this.skip = true;
other.connections.allowTo(this, portRange, description);
this.skip = false;
other.connections.remoteRule = true;
try {
other.connections.allowTo(this, portRange, description);
}
finally {
this.skip = false;
other.connections.remoteRule = false;
}
}

@@ -185,2 +206,2 @@ /**

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29ubmVjdGlvbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb25uZWN0aW9ucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUNBLCtEQUFnRjtBQW1EaEY7Ozs7Ozs7Ozs7R0FVRztBQUNILE1BQWEsV0FBVztJQXVCdEIsWUFBWSxRQUEwQixFQUFFO1FBZnhDOzs7OztXQUtHO1FBQ2Msb0JBQWUsR0FBRyxJQUFJLFlBQVksRUFBa0IsQ0FBQztRQUV0RTs7V0FFRztRQUNjLHdCQUFtQixHQUFHLElBQUksWUFBWSxFQUFzQixDQUFDO1FBRXRFLFNBQUksR0FBWSxLQUFLLENBQUM7UUFHNUIsSUFBSSxDQUFDLFdBQVcsR0FBRyxJQUFJLENBQUM7UUFDeEIsSUFBSSxDQUFDLGVBQWUsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxjQUFjLElBQUksRUFBRSxDQUFDLENBQUMsQ0FBQztRQUUzRCxJQUFJLENBQUMsbUJBQW1CLENBQUMsSUFBSSxDQUFDLEdBQUcsSUFBSSxDQUFDLGVBQWUsQ0FBQyxPQUFPLEVBQUUsQ0FBQyxDQUFDO1FBQ2pFLElBQUksS0FBSyxDQUFDLGlCQUFpQixFQUFFO1lBQzNCLElBQUksQ0FBQyxtQkFBbUIsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLGlCQUFpQixDQUFDLENBQUM7U0FDeEQ7UUFFRCxJQUFJLENBQUMsZ0JBQWdCLEdBQUcsS0FBSyxDQUFDLGdCQUFnQixDQUFDO0lBQ2pELENBQUM7SUFFRCxJQUFXLGNBQWM7UUFDdkIsT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B4IG9mIHhzKSB7XG4gICAgICAgIGxpc3RlbmVyKHgpO1xuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIHB1YmxpYyBmb3JFYWNoQW5kRm9yZXZlcihsaXN0ZW5lcjogQWN0aW9uPFQ+KSB7XG4gICAgZm9yIChjb25zdCBlbGVtZW50IG9mIHRoaXMuZWxlbWVudHMpIHtcbiAgICAgIGxpc3RlbmVyKGVsZW1lbnQpO1xuICAgIH1cbiAgICB0aGlzLmxpc3RlbmVycy5wdXNoKGxpc3RlbmVyKTtcbiAgfVxuXG4gIHB1YmxpYyBhc0FycmF5KCk6IFRbXSB7XG4gICAgcmV0dXJuIHRoaXMuZWxlbWVudHMuc2xpY2UoKTtcbiAgfVxuXG4gIHB1YmxpYyBnZXQgbGVuZ3RoKCk6IG51bWJlciB7XG4gICAgcmV0dXJuIHRoaXMuZWxlbWVudHMubGVuZ3RoO1xuICB9XG59Il19

53

lib/security-group.d.ts

@@ -1,2 +0,2 @@

import { Construct, IConstruct, ITaggable, TagManager, Tags } from '@aws-cdk/cdk';
import { Construct, IConstruct } from '@aws-cdk/cdk';
import { Connections, IConnectable } from './connections';

@@ -6,5 +6,29 @@ import { IPortRange, ISecurityGroupRule } from './security-group-rule';

export interface ISecurityGroup extends IConstruct, ISecurityGroupRule, IConnectable {
/**
* ID for the current security group
*/
readonly securityGroupId: string;
addIngressRule(peer: ISecurityGroupRule, connection: IPortRange, description?: string): void;
addEgressRule(peer: ISecurityGroupRule, connection: IPortRange, description?: string): void;
/**
* Add an ingress rule for the current security group
*
* `remoteRule` controls where the Rule object is created if the peer is also a
* securityGroup and they are in different stack. If false (default) the
* rule object is created under the current SecurityGroup object. If true and the
* peer is also a SecurityGroup, the rule object is created under the remote
* SecurityGroup object.
*/
addIngressRule(peer: ISecurityGroupRule, connection: IPortRange, description?: string, remoteRule?: boolean): void;
/**
* Add an egress rule for the current security group
*
* `remoteRule` controls where the Rule object is created if the peer is also a
* securityGroup and they are in different stack. If false (default) the
* rule object is created under the current SecurityGroup object. If true and the
* peer is also a SecurityGroup, the rule object is created under the remote
* SecurityGroup object.
*/
addEgressRule(peer: ISecurityGroupRule, connection: IPortRange, description?: string, remoteRule?: boolean): void;
/**
* Export the security group
*/
export(): SecurityGroupImportProps;

@@ -22,2 +46,6 @@ }

export declare abstract class SecurityGroupBase extends Construct implements ISecurityGroup {
/**
* Return whether the indicated object is a security group
*/
static isSecurityGroup(construct: any): construct is SecurityGroupBase;
abstract readonly securityGroupId: string;

@@ -30,5 +58,6 @@ readonly canInlineRule = false;

readonly defaultPortRange?: IPortRange;
constructor(scope: Construct, id: string);
readonly uniqueId: string;
addIngressRule(peer: ISecurityGroupRule, connection: IPortRange, description?: string): void;
addEgressRule(peer: ISecurityGroupRule, connection: IPortRange, description?: string): void;
addIngressRule(peer: ISecurityGroupRule, connection: IPortRange, description?: string, remoteRule?: boolean): void;
addEgressRule(peer: ISecurityGroupRule, connection: IPortRange, description?: string, remoteRule?: boolean): void;
toIngressRuleJSON(): any;

@@ -60,6 +89,2 @@ toEgressRuleJSON(): any;

/**
* The AWS resource tags to associate with the security group.
*/
tags?: Tags;
/**
* The VPC in which to create the security group.

@@ -86,3 +111,3 @@ */

*/
export declare class SecurityGroup extends SecurityGroupBase implements ITaggable {
export declare class SecurityGroup extends SecurityGroupBase {
/**

@@ -104,6 +129,2 @@ * Import an existing SecurityGroup

readonly securityGroupId: string;
/**
* Manage tags for this construct and children
*/
readonly tags: TagManager;
private readonly securityGroup;

@@ -118,4 +139,4 @@ private readonly directIngressRules;

export(): SecurityGroupImportProps;
addIngressRule(peer: ISecurityGroupRule, connection: IPortRange, description?: string): void;
addEgressRule(peer: ISecurityGroupRule, connection: IPortRange, description?: string): void;
addIngressRule(peer: ISecurityGroupRule, connection: IPortRange, description?: string, remoteRule?: boolean): void;
addEgressRule(peer: ISecurityGroupRule, connection: IPortRange, description?: string, remoteRule?: boolean): void;
/**

@@ -122,0 +143,0 @@ * Add a direct ingress rule

@@ -6,2 +6,3 @@ "use strict";

const ec2_generated_1 = require("./ec2.generated");
const isSecurityGroupSymbol = Symbol.for('aws-cdk:isSecurityGroup');
/**

@@ -11,30 +12,35 @@ * A SecurityGroup that is not created in this template

class SecurityGroupBase extends cdk_1.Construct {
constructor() {
super(...arguments);
constructor(scope, id) {
super(scope, id);
this.canInlineRule = false;
this.connections = new connections_1.Connections({ securityGroups: [this] });
Object.defineProperty(this, isSecurityGroupSymbol, { value: true });
}
/**
* Return whether the indicated object is a security group
*/
static isSecurityGroup(construct) {
return construct[isSecurityGroupSymbol] === true;
}
get uniqueId() {
return this.node.uniqueId;
}
addIngressRule(peer, connection, description) {
let id = `from ${peer.uniqueId}:${connection}`;
addIngressRule(peer, connection, description, remoteRule) {
if (description === undefined) {
description = id;
description = `from ${peer.uniqueId}:${connection}`;
}
id = id.replace('/', '_');
const [scope, id] = determineRuleScope(this, peer, connection, 'from', remoteRule);
// Skip duplicates
if (this.node.tryFindChild(id) === undefined) {
new ec2_generated_1.CfnSecurityGroupIngress(this, id, Object.assign({ groupId: this.securityGroupId }, peer.toIngressRuleJSON(), connection.toRuleJSON(), { description }));
if (scope.node.tryFindChild(id) === undefined) {
new ec2_generated_1.CfnSecurityGroupIngress(scope, id, Object.assign({ groupId: this.securityGroupId }, peer.toIngressRuleJSON(), connection.toRuleJSON(), { description }));
}
}
addEgressRule(peer, connection, description) {
let id = `to ${peer.uniqueId}:${connection}`;
addEgressRule(peer, connection, description, remoteRule) {
if (description === undefined) {
description = id;
description = `to ${peer.uniqueId}:${connection}`;
}
id = id.replace('/', '_');
const [scope, id] = determineRuleScope(this, peer, connection, 'to', remoteRule);
// Skip duplicates
if (this.node.tryFindChild(id) === undefined) {
new ec2_generated_1.CfnSecurityGroupEgress(this, id, Object.assign({ groupId: this.securityGroupId }, peer.toEgressRuleJSON(), connection.toRuleJSON(), { description }));
if (scope.node.tryFindChild(id) === undefined) {
new ec2_generated_1.CfnSecurityGroupEgress(scope, id, Object.assign({ groupId: this.securityGroupId }, peer.toEgressRuleJSON(), connection.toRuleJSON(), { description }));
}

@@ -51,2 +57,64 @@ }

/**
* Determine where to parent a new ingress/egress rule
*
* A SecurityGroup rule is parented under the group it's related to, UNLESS
* we're in a cross-stack scenario with another Security Group. In that case,
* we respect the 'remoteRule' flag and will parent under the other security
* group.
*
* This is necessary to avoid cyclic dependencies between stacks, since both
* ingress and egress rules will reference both security groups, and a naive
* parenting will lead to the following situation:
*
* ╔════════════════════╗ ╔════════════════════╗
* ║ ┌───────────┐ ║ ║ ┌───────────┐ ║
* ║ │ GroupA │◀────╬─┐ ┌───╬───▶│ GroupB │ ║
* ║ └───────────┘ ║ │ │ ║ └───────────┘ ║
* ║ ▲ ║ │ │ ║ ▲ ║
* ║ │ ║ │ │ ║ │ ║
* ║ │ ║ │ │ ║ │ ║
* ║ ┌───────────┐ ║ └───┼───╬────┌───────────┐ ║
* ║ │ EgressA │─────╬─────┘ ║ │ IngressB │ ║
* ║ └───────────┘ ║ ║ └───────────┘ ║
* ║ ║ ║ ║
* ╚════════════════════╝ ╚════════════════════╝
*
* By having the ability to switch the parent, we avoid the cyclic reference by
* keeping all rules in a single stack.
*
* If this happens, we also have to change the construct ID, because
* otherwise we might have two objects with the same ID if we have
* multiple reversed security group relationships.
*
* ╔═══════════════════════════════════╗
* ║┌───────────┐ ║
* ║│ GroupB │ ║
* ║└───────────┘ ║
* ║ ▲ ║
* ║ │ ┌───────────┐ ║
* ║ ├────"from A"──│ IngressB │ ║
* ║ │ └───────────┘ ║
* ║ │ ┌───────────┐ ║
* ║ ├─────"to B"───│ EgressA │ ║
* ║ │ └───────────┘ ║
* ║ │ ┌───────────┐ ║
* ║ └─────"to B"───│ EgressC │ ║ <-- oops
* ║ └───────────┘ ║
* ╚═══════════════════════════════════╝
*/
function determineRuleScope(group, peer, connection, fromTo, remoteRule) {
if (remoteRule && SecurityGroupBase.isSecurityGroup(peer) && differentStacks(group, peer)) {
// Reversed
const reversedFromTo = fromTo === 'from' ? 'to' : 'from';
return [peer, `${group.uniqueId}:${connection} ${reversedFromTo}`];
}
else {
// Regular (do old ID escaping to in order to not disturb existing deployments)
return [group, `${fromTo} ${peer.uniqueId}:${connection}`.replace('/', '_')];
}
}
function differentStacks(group1, group2) {
return cdk_1.Stack.find(group1) !== cdk_1.Stack.find(group2);
}
/**
* Creates an Amazon EC2 security group within a VPC.

@@ -63,3 +131,2 @@ *

this.directEgressRules = [];
this.tags = new cdk_1.TagManager(this, { initialTags: props.tags });
const groupDescription = props.description || this.node.path;

@@ -73,3 +140,2 @@ this.allowAllOutbound = props.allowAllOutbound !== false;

vpcId: props.vpc.vpcId,
tags: this.tags,
});

@@ -95,5 +161,5 @@ this.securityGroupId = this.securityGroup.securityGroupId;

}
addIngressRule(peer, connection, description) {
addIngressRule(peer, connection, description, remoteRule) {
if (!peer.canInlineRule || !connection.canInlineRule) {
super.addIngressRule(peer, connection, description);
super.addIngressRule(peer, connection, description, remoteRule);
return;

@@ -106,3 +172,3 @@ }

}
addEgressRule(peer, connection, description) {
addEgressRule(peer, connection, description, remoteRule) {
if (this.allowAllOutbound) {

@@ -121,3 +187,3 @@ // In the case of "allowAllOutbound", we don't add any more rules. There

if (!peer.canInlineRule || !connection.canInlineRule) {
super.addEgressRule(peer, connection, description);
super.addEgressRule(peer, connection, description, remoteRule);
return;

@@ -268,2 +334,2 @@ }

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VjdXJpdHktZ3JvdXAuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJzZWN1cml0eS1ncm91cC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHNDQUFpRztBQUNqRywrQ0FBMEQ7QUFDMUQsbURBQW9HO0FBa0JwRzs7R0FFRztBQUNILE1BQXNCLGlCQUFrQixTQUFRLGVBQVM7SUFBekQ7O1FBRWtCLGtCQUFhLEdBQUcsS0FBSyxDQUFDO1FBQ3RCLGdCQUFXLEdBQ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DilZDilZDilZDilZDilZDilZDilZDilZcgICAgICAgICDilZTilZDilZDilZDilZDilZDilZDilZDilZDilZDilZDilZDilZDilZDilZDilZDilZDilZDilZDilZDilZDilZdcbiAqICAg4pWRICDilIzilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilJAgICAgIOKVkSAgICAgICAgIOKVkSAgICDilIzilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilJAgICDilZFcbiAqICAg4pWRICDilIIgIEdyb3VwQSAgIOKUguKXgOKUgOKUgOKUgOKUgOKVrOKUgOKUkCAgIOKUjOKUgOKUgOKUgOKVrOKUgOKUgOKUgOKWtuKUgiAgR3JvdXBCICAg4pSCICAg4pWRXG4gKiAgIOKVkSAg4pSU4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSYICAgICDilZEg4pSCICAg4pSCICAg4pWRICAgIOKUlOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUmCAgIOKVkVxuICogICDilZEgICAgICAgIOKWsiAgICAgICAgICAg4pWRIOKUgiAgIOKUgiAgIOKVkSAgICAgICAgICDilrIgICAgICAgICDilZFcbiAqICAg4pWRICAgICAgICDilIIgICAgICAgICAgIOKVkSDilIIgICDilIIgICDilZEgICAgICAgICAg4pSCICAgICAgICAg4pWRXG4gKiAgIOKVkSAgICAgICAg4pSCICAgICAgICAgICDilZEg4pSCICAg4pSCICAg4pWRICAgICAgICAgIOKUgiAgICAgICAgIOKVkVxuICogICDilZEgIOKUjOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUkCAgICAg4pWRIOKUlOKUgOKUgOKUgOKUvOKUgOKUgOKUgOKVrOKUgOKUgOKUgOKUgOKUjOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUkCAgIOKVkVxuICogICDilZEgIOKUgiAgRWdyZXNzQSAg4pSC4pSA4pSA4pSA4pSA4pSA4pWs4pSA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OKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVl1xuICogICDilZHilIzilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilJAgICAgICAgICAgICAgICAgICAgICAg4pWRXG4gKiAgIOKVkeKUgiAgR3JvdXBCICAg4pSCICAgICAgICAgICAgICAgICAgICAgIOKVkVxuICogICDilZHilJTilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilJggICAgICAgICAgICAgICAgICAgICAg4pWRXG4gKiAgIOKVkSAgICAgIOKWsiAgICAgICAgICAgICAgICAgICAgICAgICAgICDilZFcbiAqICAg4pWRICAgICAg4pSCICAgICAgICAgICAgICDilIzilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilJAg4pWRXG4gKiAgIOKVkSAgICAgIOKUnOKUgOKUgOKUgOKUgFwiZnJvbSBBXCLilIDilIDilIIgSW5ncmVzc0IgIOKUgiDilZFcbiAqICAg4pWRICAgICAg4pSCICAgICAgICAgICAgICDilJTilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilJgg4pWRXG4gKiAgIOKVkSAgICAgIOKUgiAgICAgICAgICAgICAg4pSM4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSQIOKVkVxuICogICDilZEgICAgICDilJzilIDilIDilIDilIDilIBcInRvIEJcIuKUgOKUgOKUgOKUgiAgRWdyZXNzQSAg4pSCIOKVkVxuICogICDilZEgICAgICDilIIgICAgICAgICAgICAgIOKUlOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUmCDilZFcbiAqICAg4pWRICAgICAg4pSCICAgICAgICAgICAgICDilIzilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilJAg4pWRXG4gKiAgIOKVkSAgICAgIOKUlOKUgOKUgOKUgOKUgOKUgFwidG8gQlwi4pSA4pSA4pSA4pSCICBFZ3Jlc3NDICDilIIg4p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vdG9jb2wgPT09ICctMSc7XG59XG4iXX0=

@@ -39,6 +39,2 @@ import cdk = require('@aws-cdk/cdk');

/**
* The AWS resource tags to associate with the VPC.
*/
tags?: cdk.Tags;
/**
* Define the maximum number of AZs to use in this region

@@ -145,6 +141,2 @@ *

name: string;
/**
* The AWS resource tags to associate with the resource.
*/
tags?: cdk.Tags;
}

@@ -171,3 +163,3 @@ /**

*/
export declare class VpcNetwork extends VpcNetworkBase implements cdk.ITaggable {
export declare class VpcNetwork extends VpcNetworkBase {
/**

@@ -218,6 +210,2 @@ * @returns The IPv4 CidrBlock as returned by the VPC

/**
* Manage tags for this construct and children
*/
readonly tags: cdk.TagManager;
/**
* The VPC resource

@@ -279,6 +267,2 @@ */

mapPublicIpOnLaunch?: boolean;
/**
* The AWS resource tags to associate with the Subnet
*/
tags?: cdk.Tags;
}

@@ -288,3 +272,3 @@ /**

*/
export declare class VpcSubnet extends cdk.Construct implements IVpcSubnet, cdk.ITaggable {
export declare class VpcSubnet extends cdk.Construct implements IVpcSubnet {
static import(scope: cdk.Construct, id: string, props: VpcSubnetImportProps): IVpcSubnet;

@@ -300,5 +284,5 @@ /**

/**
* Manage tags for Construct and propagate to children
* Parts of this VPC subnet
*/
readonly tags: cdk.TagManager;
readonly dependencyElements: cdk.IDependable[];
/**

@@ -305,0 +289,0 @@ * The routeTableId attached to this subnet.

{
"name": "@aws-cdk/aws-ec2",
"version": "0.23.0",
"version": "0.24.0",
"description": "CDK Constructs for AWS EC2",

@@ -57,17 +57,17 @@ "main": "lib/index.js",

"devDependencies": {
"@aws-cdk/assert": "^0.23.0",
"cdk-build-tools": "^0.23.0",
"cdk-integ-tools": "^0.23.0",
"cfn2ts": "^0.23.0",
"pkglint": "^0.23.0"
"@aws-cdk/assert": "^0.24.0",
"cdk-build-tools": "^0.24.0",
"cdk-integ-tools": "^0.24.0",
"cfn2ts": "^0.24.0",
"pkglint": "^0.24.0"
},
"dependencies": {
"@aws-cdk/aws-iam": "^0.23.0",
"@aws-cdk/cdk": "^0.23.0",
"@aws-cdk/cx-api": "^0.23.0"
"@aws-cdk/aws-iam": "^0.24.0",
"@aws-cdk/cdk": "^0.24.0",
"@aws-cdk/cx-api": "^0.24.0"
},
"homepage": "https://github.com/awslabs/aws-cdk",
"peerDependencies": {
"@aws-cdk/cdk": "^0.23.0",
"@aws-cdk/cx-api": "^0.23.0"
"@aws-cdk/cdk": "^0.24.0",
"@aws-cdk/cx-api": "^0.24.0"
},

@@ -82,2 +82,2 @@ "engines": {

}
}
}

@@ -21,14 +21,8 @@ {

"PublicSubnets": {
"Value": "ids:subnet-e19455ca,subnet-e0c24797,subnet-ccd77395",
"Export": {
"Name": "aws-cdk-ec2-import:PublicSubnets"
}
"Value": "ids:subnet-e19455ca,subnet-e0c24797,subnet-ccd77395"
},
"PrivateSubnets": {
"Value": "ids:",
"Export": {
"Name": "aws-cdk-ec2-import:PrivateSubnets"
}
"Value": "ids:"
}
}
}
}

@@ -8,3 +8,6 @@ import { Test } from 'nodeunit';

'multiple security groups allows internally between them'(test: Test): void;
'can establish cross stack Security Group connections - allowFrom'(test: Test): void;
'can establish cross stack Security Group connections - allowTo'(test: Test): void;
'can establish multiple cross-stack SGs'(test: Test): void;
};
export = _default;

@@ -137,3 +137,74 @@ "use strict";

},
'can establish cross stack Security Group connections - allowFrom'(test) {
// GIVEN
const app = new cdk_1.App();
const stack1 = new cdk_1.Stack(app, 'Stack1');
const vpc1 = new lib_1.VpcNetwork(stack1, 'VPC');
const sg1 = new lib_1.SecurityGroup(stack1, 'SecurityGroup', { vpc: vpc1, allowAllOutbound: false });
const stack2 = new cdk_1.Stack(app, 'Stack2');
const vpc2 = new lib_1.VpcNetwork(stack2, 'VPC');
const sg2 = new lib_1.SecurityGroup(stack2, 'SecurityGroup', { vpc: vpc2, allowAllOutbound: false });
// WHEN
sg2.connections.allowFrom(sg1, new lib_1.TcpPort(100));
// THEN -- both rules are in Stack2
app.node.prepareTree();
assert_1.expect(stack2).to(assert_1.haveResource('AWS::EC2::SecurityGroupIngress', {
GroupId: { "Fn::GetAtt": ["SecurityGroupDD263621", "GroupId"] },
SourceSecurityGroupId: { "Fn::ImportValue": "Stack1:ExportsOutputFnGetAttSecurityGroupDD263621GroupIdDF6F8B09" },
}));
assert_1.expect(stack2).to(assert_1.haveResource('AWS::EC2::SecurityGroupEgress', {
GroupId: { "Fn::ImportValue": "Stack1:ExportsOutputFnGetAttSecurityGroupDD263621GroupIdDF6F8B09" },
DestinationSecurityGroupId: { "Fn::GetAtt": ["SecurityGroupDD263621", "GroupId"] },
}));
test.done();
},
'can establish cross stack Security Group connections - allowTo'(test) {
// GIVEN
const app = new cdk_1.App();
const stack1 = new cdk_1.Stack(app, 'Stack1');
const vpc1 = new lib_1.VpcNetwork(stack1, 'VPC');
const sg1 = new lib_1.SecurityGroup(stack1, 'SecurityGroup', { vpc: vpc1, allowAllOutbound: false });
const stack2 = new cdk_1.Stack(app, 'Stack2');
const vpc2 = new lib_1.VpcNetwork(stack2, 'VPC');
const sg2 = new lib_1.SecurityGroup(stack2, 'SecurityGroup', { vpc: vpc2, allowAllOutbound: false });
// WHEN
sg2.connections.allowTo(sg1, new lib_1.TcpPort(100));
// THEN -- both rules are in Stack2
app.node.prepareTree();
assert_1.expect(stack2).to(assert_1.haveResource('AWS::EC2::SecurityGroupIngress', {
GroupId: { "Fn::ImportValue": "Stack1:ExportsOutputFnGetAttSecurityGroupDD263621GroupIdDF6F8B09" },
SourceSecurityGroupId: { "Fn::GetAtt": ["SecurityGroupDD263621", "GroupId"] },
}));
assert_1.expect(stack2).to(assert_1.haveResource('AWS::EC2::SecurityGroupEgress', {
GroupId: { "Fn::GetAtt": ["SecurityGroupDD263621", "GroupId"] },
DestinationSecurityGroupId: { "Fn::ImportValue": "Stack1:ExportsOutputFnGetAttSecurityGroupDD263621GroupIdDF6F8B09" },
}));
test.done();
},
'can establish multiple cross-stack SGs'(test) {
// GIVEN
const app = new cdk_1.App();
const stack1 = new cdk_1.Stack(app, 'Stack1');
const vpc1 = new lib_1.VpcNetwork(stack1, 'VPC');
const sg1a = new lib_1.SecurityGroup(stack1, 'SecurityGroupA', { vpc: vpc1, allowAllOutbound: false });
const sg1b = new lib_1.SecurityGroup(stack1, 'SecurityGroupB', { vpc: vpc1, allowAllOutbound: false });
const stack2 = new cdk_1.Stack(app, 'Stack2');
const vpc2 = new lib_1.VpcNetwork(stack2, 'VPC');
const sg2 = new lib_1.SecurityGroup(stack2, 'SecurityGroup', { vpc: vpc2, allowAllOutbound: false });
// WHEN
sg2.connections.allowFrom(sg1a, new lib_1.TcpPort(100));
sg2.connections.allowFrom(sg1b, new lib_1.TcpPort(100));
// THEN -- both egress rules are in Stack2
app.node.prepareTree();
assert_1.expect(stack2).to(assert_1.haveResource('AWS::EC2::SecurityGroupEgress', {
GroupId: { "Fn::ImportValue": "Stack1:ExportsOutputFnGetAttSecurityGroupAED40ADC5GroupId1D10C76A" },
DestinationSecurityGroupId: { "Fn::GetAtt": ["SecurityGroupDD263621", "GroupId"] },
}));
assert_1.expect(stack2).to(assert_1.haveResource('AWS::EC2::SecurityGroupEgress', {
GroupId: { "Fn::ImportValue": "Stack1:ExportsOutputFnGetAttSecurityGroupB04591F90GroupIdFA7208D5" },
DestinationSecurityGroupId: { "Fn::GetAtt": ["SecurityGroupDD263621", "GroupId"] },
}));
test.done();
}
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5jb25uZWN0aW9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QuY29ubmVjdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDRDQUF1RDtBQUN2RCxzQ0FBcUM7QUFHckMsZ0NBT2dCO0FBMkpoQixNQUFNLG9CQUFvQjtJQUN4QixZQUE0QixXQUF3QjtRQUF4QixnQkFBVyxHQUFYLFdBQVcsQ0FBYTtJQUNwRCxDQUFDO0NBQ0Y7QUE1SkQsa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yKHB1YmxpYyByZWFkb25seSBjb25uZWN0aW9uczogQ29ubmVjdGlvbnMpIHtcbiAgfVxufVxuIl19

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc