Skip to content

Commit 7d1c83f

Browse files
author
Yuriy Bezsonov
committed
WIP
1 parent 1ee3962 commit 7d1c83f

File tree

3 files changed

+34
-30
lines changed

3 files changed

+34
-30
lines changed

infra/cdk/src/main/java/sample/com/constructs/Ide.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,18 +422,22 @@ public Ide(final Construct scope, final String id, final IdeProps props) {
422422
.build();
423423
waitCondition.getNode().addDependency(ec2InstanceResource);
424424

425-
// Outputs
426-
CfnOutput.Builder.create(this, "IdeUrl")
425+
// CloudFront doesn't need to wait for bootstrap - it's just infrastructure
426+
427+
// Outputs - these should only be created if bootstrap succeeds
428+
var ideUrlOutput = CfnOutput.Builder.create(this, "IdeUrl")
427429
.value("https://" + distribution.getDistributionDomainName())
428430
.description("Workshop IDE Url")
429431
.exportName(instanceName + "-url")
430432
.build();
433+
ideUrlOutput.getNode().addDependency(waitCondition);
431434

432-
CfnOutput.Builder.create(this, "IdePassword")
435+
var idePasswordOutput = CfnOutput.Builder.create(this, "IdePassword")
433436
.value(ideSecretsManagerPassword.secretValueFromJson("password").unsafeUnwrap())
434437
.description("Workshop IDE Password")
435438
.exportName(instanceName + "-password")
436439
.build();
440+
idePasswordOutput.getNode().addDependency(waitCondition);
437441
}
438442

439443
public SecurityGroup getIdeSecurityGroup() {

infra/scripts/ide/bootstrap.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ retry_critical() { retry_command 5 5 "FAIL" "$@"; }
5353
retry_optional() { retry_command 5 5 "LOG" "$@"; }
5454

5555
echo "Updating system packages..."
56-
dnf update -y
56+
sudo dnf update -y
5757

5858
echo "Installing jq (required for secret parsing)..."
59-
dnf install -y jq
59+
sudo dnf install -y jq
6060

6161
echo "Installing AWS CLI..."
6262
retry_critical "curl -LSsf -o /tmp/aws-cli.zip https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip && unzip -q -d /tmp /tmp/aws-cli.zip && /tmp/aws/install --update && rm -rf /tmp/aws*"

infra/workshop-template.yaml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -719,30 +719,6 @@ Resources:
719719
Fn::GetAtt:
720720
- IdeInstanceLauncherFunction803C5A2A
721721
- Arn
722-
InstanceName: ide
723-
IamInstanceProfileArn:
724-
Fn::GetAtt:
725-
- IdeIdeInstanceProfile8BD997EA
726-
- Arn
727-
VolumeSize: "50"
728-
SubnetIds:
729-
Fn::Join:
730-
- ""
731-
- - Ref: VpcWorkshopVpcPublicSubnet1SubnetBCB45C45
732-
- ","
733-
- Ref: VpcWorkshopVpcPublicSubnet2SubnetF8F9426F
734-
SecurityGroupIds:
735-
Fn::Join:
736-
- ""
737-
- - Fn::GetAtt:
738-
- IdeIdeSecurityGroup5C503C8A
739-
- GroupId
740-
- ","
741-
- Fn::GetAtt:
742-
- IdeIdeInternalSecurityGroupD5D3B421
743-
- GroupId
744-
ImageId:
745-
Ref: SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter
746722
UserData:
747723
Fn::Base64:
748724
Fn::Join:
@@ -862,6 +838,30 @@ Resources:
862838
exit 1
863839
fi
864840
InstanceTypes: m5.xlarge,m6i.xlarge,t3.xlarge
841+
InstanceName: ide
842+
IamInstanceProfileArn:
843+
Fn::GetAtt:
844+
- IdeIdeInstanceProfile8BD997EA
845+
- Arn
846+
VolumeSize: "50"
847+
SubnetIds:
848+
Fn::Join:
849+
- ""
850+
- - Ref: VpcWorkshopVpcPublicSubnet1SubnetBCB45C45
851+
- ","
852+
- Ref: VpcWorkshopVpcPublicSubnet2SubnetF8F9426F
853+
SecurityGroupIds:
854+
Fn::Join:
855+
- ""
856+
- - Fn::GetAtt:
857+
- IdeIdeSecurityGroup5C503C8A
858+
- GroupId
859+
- ","
860+
- Fn::GetAtt:
861+
- IdeIdeInternalSecurityGroupD5D3B421
862+
- GroupId
863+
ImageId:
864+
Ref: SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter
865865
UpdateReplacePolicy: Delete
866866
DeletionPolicy: Delete
867867
IdeIdeEipAssociation6C6C215D:
@@ -1371,13 +1371,13 @@ Resources:
13711371
Fn::GetAtt:
13721372
- CodeBuildStartLambdaFunction8349284F
13731373
- Arn
1374+
ContentHash: "1765685570178"
13741375
ProjectName:
13751376
Ref: CodeBuildProjectA0FF5539
13761377
CodeBuildIamRoleArn:
13771378
Fn::GetAtt:
13781379
- CodeBuildCodeBuildRoleBA9C6D5C
13791380
- Arn
1380-
ContentHash: "1765684594106"
13811381
DependsOn:
13821382
- CodeBuildBuildCompleteRuleAllowEventRuleWorkshopStackCodeBuildReportLambdaFunctionD77C6091DA4A4BD8
13831383
- CodeBuildBuildCompleteRule06AAF17D

0 commit comments

Comments
 (0)