Skip to content

Commit

Permalink
feat: add dependsOn for beanstalk environment (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryands17 authored May 8, 2020
1 parent 241aaaf commit 4b15c46
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import cdk = require('@aws-cdk/core');
import elasticbeanstalk = require('@aws-cdk/aws-elasticbeanstalk');
import * as cdk from '@aws-cdk/core';
import * as elasticbeanstalk from '@aws-cdk/aws-elasticbeanstalk';


export class CdkStack extends cdk.Stack {
Expand All @@ -18,11 +18,14 @@ export class CdkStack extends cdk.Stack {
applicationName: appName
});

new elasticbeanstalk.CfnEnvironment(this, 'Environment', {
const env = new elasticbeanstalk.CfnEnvironment(this, 'Environment', {
environmentName: 'MySampleEnvironment',
applicationName: app.applicationName || appName,
platformArn: platform
});

// to ensure the application is created before the environment
env.addDependsOn(app);
}
}

Expand Down

0 comments on commit 4b15c46

Please sign in to comment.