Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
Need to pass in default value for when AppStream not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Nguyen committed Jul 12, 2021
1 parent 32dc77f commit 173d0b6
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,13 @@ class ProvisionAccount extends StepBase {
this.payload.string('workflowRoleArn'),
this.payload.string('apiHandlerArn'),
this.payload.string('callerAccountId'),
this.payload.string('appStreamFleetDesiredInstances'),
this.payload.string('appStreamDisconnectTimeoutSeconds'),
this.payload.string('appStreamIdleDisconnectTimeoutSeconds'),
this.payload.string('appStreamMaxUserDurationSeconds'),
this.payload.string('appStreamImageName'),
this.payload.string('appStreamInstanceType'),
this.payload.string('appStreamFleetType'),
this.payload.optionalString('appStreamFleetDesiredInstances', '0'),
this.payload.optionalString('appStreamDisconnectTimeoutSeconds', '0'),
this.payload.optionalString('appStreamIdleDisconnectTimeoutSeconds', '0'),
this.payload.optionalString('appStreamMaxUserDurationSeconds', '0'),
this.payload.optionalString('appStreamImageName'),
this.payload.optionalString('appStreamInstanceType'),
this.payload.optionalString('appStreamFleetType', 'ON_DEMAND'),
]);
// deploy basic stacks to the account just created
const [cfnTemplateService] = await this.mustFindServices(['cfnTemplateService']);
Expand Down Expand Up @@ -267,13 +267,6 @@ class ProvisionAccount extends StepBase {
// create S3 and KMS resources access for newly created account
await this.updateLocalResourcePolicies();

// Start AppStream Fleet and wait for AppStream fleet to transition to RUNNING state
await this.startAppStreamFleet(cfnOutputs.AppStreamFleet);
const isAppStreamFleetRunning = await this.checkAppStreamFleetIsRunning(cfnOutputs.AppStreamFleet);
if (!isAppStreamFleetRunning) {
return false;
}

await this.updateAccount({
status: 'COMPLETED',
cfnInfo: {
Expand Down Expand Up @@ -308,6 +301,13 @@ class ProvisionAccount extends StepBase {
};
let additionalAccountData = {};
if (this.settings.get(settingKeys.isAppStreamEnabled) === 'true') {
// Start AppStream Fleet and wait for AppStream fleet to transition to RUNNING state
await this.startAppStreamFleet(cfnOutputs.AppStreamFleet);
const isAppStreamFleetRunning = await this.checkAppStreamFleetIsRunning(cfnOutputs.AppStreamFleet);
if (!isAppStreamFleetRunning) {
return false;
}

additionalAccountData = {
appStreamStackName: cfnOutputs.AppStreamStackName,
appStreamSecurityGroupId: cfnOutputs.AppStreamSecurityGroup,
Expand Down

0 comments on commit 173d0b6

Please sign in to comment.