Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove "export"s and normalize resource names #2580

Merged
merged 39 commits into from
May 18, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
autoscaling
Elad Ben-Israel committed May 17, 2019
commit 640c7784b654fee3aa098d8679dcdbcbd9bf4efb
Original file line number Diff line number Diff line change
@@ -148,7 +148,7 @@ export interface AutoScalingGroupProps extends CommonAutoScalingGroupProps {
/**
* VPC to launch these instances in.
*/
readonly vpc: ec2.IVpcNetwork;
readonly vpc: ec2.IVpc;

/**
* Type of instance to launch
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import autoscaling = require('../lib');
const app = new cdk.App();
const stack = new cdk.Stack(app, 'aws-cdk-autoscaling-integ');

const vpc = new ec2.VpcNetwork(stack, 'VPC', {
const vpc = new ec2.Vpc(stack, 'VPC', {
maxAZs: 2
});

Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import autoscaling = require('../lib');
const app = new cdk.App();
const stack = new cdk.Stack(app, 'aws-cdk-asg-integ');

const vpc = new ec2.VpcNetwork(stack, 'VPC', {
const vpc = new ec2.Vpc(stack, 'VPC', {
maxAZs: 3
});

Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import autoscaling = require('../lib');
const app = new cdk.App();
const stack = new cdk.Stack(app, 'aws-cdk-asg-integ');

const vpc = new ec2.VpcNetwork(stack, 'VPC', {
const vpc = new ec2.Vpc(stack, 'VPC', {
maxAZs: 2
});

Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import autoscaling = require('../lib');
const app = new cdk.App();
const stack = new cdk.Stack(app, 'aws-cdk-autoscaling-integ');

const vpc = new ec2.VpcNetwork(stack, 'VPC', {
const vpc = new ec2.Vpc(stack, 'VPC', {
maxAZs: 2
});

Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ class TestStack extends cdk.Stack {
constructor(scope: cdk.App, id: string) {
super(scope, id);

const vpc = new ec2.VpcNetwork(this, 'VPC');
const vpc = new ec2.Vpc(this, 'VPC');
const role = new iam.Role(this, 'Role', {
assumedBy: new iam.ServicePrincipal('ec2.amazonaws.com')
});
Original file line number Diff line number Diff line change
@@ -524,7 +524,7 @@ export = {
};

function mockVpc(stack: cdk.Stack) {
return ec2.VpcNetwork.import(stack, 'MyVpc', {
return ec2.Vpc.fromVpcAttributes(stack, 'MyVpc', {
vpcId: 'my-vpc',
availabilityZones: [ 'az1' ],
publicSubnetIds: [ 'pub1' ],
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ export = {
'we can add a lifecycle hook to an ASG'(test: Test) {
// GIVEN
const stack = new cdk.Stack();
const vpc = new ec2.VpcNetwork(stack, 'VPC');
const vpc = new ec2.Vpc(stack, 'VPC');
const asg = new autoscaling.AutoScalingGroup(stack, 'ASG', {
vpc,
instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro),
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-autoscaling/test/test.scaling.ts
Original file line number Diff line number Diff line change
@@ -224,13 +224,13 @@ export = {
};

class ASGFixture extends cdk.Construct {
public readonly vpc: ec2.VpcNetwork;
public readonly vpc: ec2.Vpc;
public readonly asg: autoscaling.AutoScalingGroup;

constructor(scope: cdk.Construct, id: string) {
super(scope, id);

this.vpc = new ec2.VpcNetwork(this, 'VPC');
this.vpc = new ec2.Vpc(this, 'VPC');
this.asg = new autoscaling.AutoScalingGroup(this, 'ASG', {
vpc: this.vpc,
instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro),
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@ export = {
};

function makeAutoScalingGroup(scope: cdk.Construct) {
const vpc = new ec2.VpcNetwork(scope, 'VPC');
const vpc = new ec2.Vpc(scope, 'VPC');
return new autoscaling.AutoScalingGroup(scope, 'ASG', {
vpc,
instanceType: new ec2.InstanceType('t2.micro'),