Browse Source

check aws_ack_auth_enabled for CF stack (#4099)

Stefan McShane 2 years ago
parent
commit
2bb636f123
2 changed files with 5 additions and 1 deletions
  1. 4 1
      dashboard/src/components/CloudFormationForm.tsx
  2. 1 0
      dashboard/src/shared/types.tsx

+ 4 - 1
dashboard/src/components/CloudFormationForm.tsx

@@ -222,7 +222,10 @@ const CloudFormationForm: React.FC<Props> = ({
     setCurrentStep(3)
     const externalId = getExternalId();
     let trustArn = process.env.TRUST_ARN ? process.env.TRUST_ARN : "arn:aws:iam::108458755588:role/CAPIManagement";
-    const cloudformation_url = `https://console.aws.amazon.com/cloudformation/home?#/stacks/create/review?templateURL=https://porter-role.s3.us-east-2.amazonaws.com/cloudformation-policy.json&stackName=PorterRole&param_ExternalIdParameter=${externalId}&param_TrustArnParameter=${trustArn}`
+    let cloudformation_url = `https://console.aws.amazon.com/cloudformation/home?#/stacks/create/review?templateURL=https://porter-role.s3.us-east-2.amazonaws.com/cloudformation-policy.json&stackName=PorterRole&param_ExternalIdParameter=${externalId}&param_TrustArnParameter=${trustArn}`
+    if (currentProject.aws_ack_auth_enabled === true) {
+      cloudformation_url = `https://console.aws.amazon.com/cloudformation/home?#/stacks/create/review?templateURL=https://porter-role.s3.us-east-2.amazonaws.com/cloudformation-access-policy.json&stackName=PorterRole&param_TrustArnParameter=${trustArn}`
+    }
     markStepStarted({ step: "aws-cloudformation-redirect-success", account_id: AWSAccountID, cloudformation_url, external_id: externalId })
     window.open(cloudformation_url, "_blank")
     setHasClickedCloudformationButton(true);

+ 1 - 0
dashboard/src/shared/types.tsx

@@ -293,6 +293,7 @@ export type ProjectType = {
   stacks_enabled: boolean;
   validate_apply_v2: boolean;
   managed_deployment_targets_enabled: boolean;
+  aws_ack_auth_enabled: boolean;
   roles: Array<{
     id: number;
     kind: string;