Skip to content

Commit 395cfe9

Browse files
author
Yuriy Bezsonov
committed
Improve infra setup
1 parent 1a19d64 commit 395cfe9

File tree

12 files changed

+200
-174
lines changed

12 files changed

+200
-174
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ build/
3535
### VS Code ###
3636
.vscode/
3737

38+
### Kiro ###
39+
.kiro/debug/
3840

3941
### Other
4042

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Build output
2+
target/
3+
4+
# IDE
5+
.idea/
6+
*.iml
7+
.vscode/
8+
.settings/
9+
.project
10+
.classpath
11+
12+
# OS
13+
.DS_Store
14+
Thumbs.db
15+
16+
# Logs
17+
*.log
18+
logs/
19+
20+
# Maven
21+
pom.xml.tag
22+
pom.xml.releaseBackup
23+
pom.xml.versionsBackup
24+
pom.xml.next
25+
release.properties
26+
27+
# Test output
28+
*.exec
29+
test-output/
30+
31+
# Kubernetes manifests (generated during workshop)
32+
k8s/
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Build output
2+
target/
3+
4+
# IDE
5+
.idea/
6+
*.iml
7+
.vscode/
8+
.settings/
9+
.project
10+
.classpath
11+
12+
# OS
13+
.DS_Store
14+
Thumbs.db
15+
16+
# Logs
17+
*.log
18+
logs/
19+
20+
# Maven
21+
pom.xml.tag
22+
pom.xml.releaseBackup
23+
pom.xml.versionsBackup
24+
pom.xml.next
25+
release.properties
26+
27+
# Test output
28+
*.exec
29+
test-output/
30+
31+
# Kubernetes manifests (generated during workshop)
32+
k8s/

infra/cdk/src/main/java/sample/com/WorkshopStack.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public WorkshopStack(final Construct scope, final String id, final StackProps pr
5858
.vpc(vpc.getVpc())
5959
.gitBranch(gitBranch)
6060
.templateType(templateType)
61+
.ideArch(Ide.IdeArch.X86_64)
6162
.build();
6263
Ide ide = new Ide(this, "Ide", ideProps);
6364

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static class IdeProps {
9898
private static final List<String> ARM64_INSTANCE_TYPES =
9999
Arrays.asList("m7g.xlarge", "m6g.xlarge", "c7g.xlarge", "t4g.xlarge");
100100
private static final List<String> X86_64_INSTANCE_TYPES =
101-
Arrays.asList("m7i-flex.xlarge", "m7a.xlarge", "m6i.xlarge", "m6a.xlarge", "m5.xlarge", "t3.xlarge");
101+
Arrays.asList("m6i.xlarge", "m5.xlarge", "m6a.xlarge", "m7i-flex.xlarge", "m7a.xlarge", "t3.xlarge");
102102
// Old instance list (x86_64) for reference:
103103
// Arrays.asList("m7i-flex.xlarge", "m7a.xlarge", "m6i.xlarge", "m6a.xlarge", "m5.xlarge", "t3.xlarge");
104104

infra/cfn/base-stack.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -676,25 +676,19 @@ Resources:
676676
Fn::GetAtt:
677677
- IdeInstanceLauncherFunction803C5A2A
678678
- Arn
679-
VolumeSize: "50"
680679
SubnetIds:
681680
Fn::Join:
682681
- ""
683682
- - Ref: VpcPublicSubnet1Subnet8E8DEDC0
684683
- ","
685684
- Ref: VpcPublicSubnet2SubnetA811849C
686-
SecurityGroupIds:
687-
Fn::Join:
688-
- ""
689-
- - Fn::GetAtt:
690-
- IdeSecurityGroup73B02454
691-
- GroupId
692-
- ","
693-
- Fn::GetAtt:
694-
- IdeInternalSecurityGroupB0A5D76B
695-
- GroupId
696-
ImageId:
697-
Ref: SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61arm64C96584B6F00A464EAD1953AFF4B05118Parameter
685+
VolumeSize: "50"
686+
IamInstanceProfileArn:
687+
Fn::GetAtt:
688+
- IdeInstanceProfile61B92038
689+
- Arn
690+
InstanceName: ide
691+
InstanceTypes: m6i.xlarge,m5.xlarge,m6a.xlarge,m7i-flex.xlarge,m7a.xlarge,t3.xlarge
698692
UserData:
699693
Fn::Base64:
700694
Fn::Join:
@@ -714,7 +708,7 @@ Resources:
714708
- |-
715709
"
716710
export TEMPLATE_TYPE="base"
717-
export ARCH="aarch64"
711+
export ARCH="x86_64"
718712
export IDE_TYPE="code-editor"
719713
export WAIT_CONDITION_HANDLE_URL="
720714
- Ref: IdeWaitConditionHandleE8345861
@@ -831,12 +825,18 @@ Resources:
831825
"
832826
exit 1
833827
fi
834-
InstanceTypes: m7g.xlarge,m6g.xlarge,c7g.xlarge,t4g.xlarge
835-
InstanceName: ide
836-
IamInstanceProfileArn:
837-
Fn::GetAtt:
838-
- IdeInstanceProfile61B92038
839-
- Arn
828+
ImageId:
829+
Ref: SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter
830+
SecurityGroupIds:
831+
Fn::Join:
832+
- ""
833+
- - Fn::GetAtt:
834+
- IdeSecurityGroup73B02454
835+
- GroupId
836+
- ","
837+
- Fn::GetAtt:
838+
- IdeInternalSecurityGroupB0A5D76B
839+
- GroupId
840840
UpdateReplacePolicy: Delete
841841
DeletionPolicy: Delete
842842
IdeEipAssociationDFF81215:
@@ -1082,7 +1082,7 @@ Outputs:
10821082
Export:
10831083
Name: ide-password
10841084
Parameters:
1085-
SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61arm64C96584B6F00A464EAD1953AFF4B05118Parameter:
1085+
SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter:
10861086
Type: AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>
1087-
Default: /aws/service/ami-amazon-linux-latest/al2023-ami-kernel-6.1-arm64
1087+
Default: /aws/service/ami-amazon-linux-latest/al2023-ami-kernel-6.1-x86_64
10881088

infra/cfn/java-ai-agents-stack.yaml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -757,24 +757,8 @@ Resources:
757757
Fn::GetAtt:
758758
- IdeInstanceLauncherFunction803C5A2A
759759
- Arn
760-
SubnetIds:
761-
Fn::Join:
762-
- ""
763-
- - Ref: VpcPublicSubnet1Subnet8E8DEDC0
764-
- ","
765-
- Ref: VpcPublicSubnet2SubnetA811849C
766-
SecurityGroupIds:
767-
Fn::Join:
768-
- ""
769-
- - Fn::GetAtt:
770-
- IdeSecurityGroup73B02454
771-
- GroupId
772-
- ","
773-
- Fn::GetAtt:
774-
- IdeInternalSecurityGroupB0A5D76B
775-
- GroupId
776760
ImageId:
777-
Ref: SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61arm64C96584B6F00A464EAD1953AFF4B05118Parameter
761+
Ref: SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter
778762
UserData:
779763
Fn::Base64:
780764
Fn::Join:
@@ -794,7 +778,7 @@ Resources:
794778
- |-
795779
"
796780
export TEMPLATE_TYPE="java-ai-agents"
797-
export ARCH="aarch64"
781+
export ARCH="x86_64"
798782
export IDE_TYPE="code-editor"
799783
export WAIT_CONDITION_HANDLE_URL="
800784
- Ref: IdeWaitConditionHandleE8345861
@@ -911,13 +895,29 @@ Resources:
911895
"
912896
exit 1
913897
fi
914-
InstanceTypes: m7g.xlarge,m6g.xlarge,c7g.xlarge,t4g.xlarge
898+
InstanceTypes: m6i.xlarge,m5.xlarge,m6a.xlarge,m7i-flex.xlarge,m7a.xlarge,t3.xlarge
915899
InstanceName: ide
916900
IamInstanceProfileArn:
917901
Fn::GetAtt:
918902
- IdeInstanceProfile61B92038
919903
- Arn
920904
VolumeSize: "50"
905+
SubnetIds:
906+
Fn::Join:
907+
- ""
908+
- - Ref: VpcPublicSubnet1Subnet8E8DEDC0
909+
- ","
910+
- Ref: VpcPublicSubnet2SubnetA811849C
911+
SecurityGroupIds:
912+
Fn::Join:
913+
- ""
914+
- - Fn::GetAtt:
915+
- IdeSecurityGroup73B02454
916+
- GroupId
917+
- ","
918+
- Fn::GetAtt:
919+
- IdeInternalSecurityGroupB0A5D76B
920+
- GroupId
921921
UpdateReplacePolicy: Delete
922922
DeletionPolicy: Delete
923923
IdeEipAssociationDFF81215:
@@ -1163,7 +1163,7 @@ Outputs:
11631163
Export:
11641164
Name: ide-password
11651165
Parameters:
1166-
SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61arm64C96584B6F00A464EAD1953AFF4B05118Parameter:
1166+
SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter:
11671167
Type: AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>
1168-
Default: /aws/service/ami-amazon-linux-latest/al2023-ami-kernel-6.1-arm64
1168+
Default: /aws/service/ami-amazon-linux-latest/al2023-ami-kernel-6.1-x86_64
11691169

infra/cfn/java-on-amazon-eks-stack.yaml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,30 @@ Resources:
777777
Fn::GetAtt:
778778
- IdeInstanceLauncherFunction803C5A2A
779779
- Arn
780+
InstanceName: ide
781+
IamInstanceProfileArn:
782+
Fn::GetAtt:
783+
- IdeInstanceProfile61B92038
784+
- Arn
785+
VolumeSize: "50"
786+
SubnetIds:
787+
Fn::Join:
788+
- ""
789+
- - Ref: VpcPublicSubnet1Subnet8E8DEDC0
790+
- ","
791+
- Ref: VpcPublicSubnet2SubnetA811849C
792+
SecurityGroupIds:
793+
Fn::Join:
794+
- ""
795+
- - Fn::GetAtt:
796+
- IdeSecurityGroup73B02454
797+
- GroupId
798+
- ","
799+
- Fn::GetAtt:
800+
- IdeInternalSecurityGroupB0A5D76B
801+
- GroupId
802+
ImageId:
803+
Ref: SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter
780804
UserData:
781805
Fn::Base64:
782806
Fn::Join:
@@ -796,7 +820,7 @@ Resources:
796820
- |-
797821
"
798822
export TEMPLATE_TYPE="java-on-amazon-eks"
799-
export ARCH="aarch64"
823+
export ARCH="x86_64"
800824
export IDE_TYPE="code-editor"
801825
export WAIT_CONDITION_HANDLE_URL="
802826
- Ref: IdeWaitConditionHandleE8345861
@@ -913,31 +937,7 @@ Resources:
913937
"
914938
exit 1
915939
fi
916-
InstanceTypes: m7g.xlarge,m6g.xlarge,c7g.xlarge,t4g.xlarge
917-
InstanceName: ide
918-
IamInstanceProfileArn:
919-
Fn::GetAtt:
920-
- IdeInstanceProfile61B92038
921-
- Arn
922-
VolumeSize: "50"
923-
SubnetIds:
924-
Fn::Join:
925-
- ""
926-
- - Ref: VpcPublicSubnet1Subnet8E8DEDC0
927-
- ","
928-
- Ref: VpcPublicSubnet2SubnetA811849C
929-
SecurityGroupIds:
930-
Fn::Join:
931-
- ""
932-
- - Fn::GetAtt:
933-
- IdeSecurityGroup73B02454
934-
- GroupId
935-
- ","
936-
- Fn::GetAtt:
937-
- IdeInternalSecurityGroupB0A5D76B
938-
- GroupId
939-
ImageId:
940-
Ref: SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61arm64C96584B6F00A464EAD1953AFF4B05118Parameter
940+
InstanceTypes: m6i.xlarge,m5.xlarge,m6a.xlarge,m7i-flex.xlarge,m7a.xlarge,t3.xlarge
941941
UpdateReplacePolicy: Delete
942942
DeletionPolicy: Delete
943943
IdeEipAssociationDFF81215:
@@ -1316,12 +1316,12 @@ Resources:
13161316
Environment:
13171317
ComputeType: BUILD_GENERAL1_MEDIUM
13181318
EnvironmentVariables:
1319-
- Name: GIT_BRANCH
1320-
Type: PLAINTEXT
1321-
Value: new-ws-infra
13221319
- Name: TEMPLATE_TYPE
13231320
Type: PLAINTEXT
13241321
Value: java-on-amazon-eks
1322+
- Name: GIT_BRANCH
1323+
Type: PLAINTEXT
1324+
Value: new-ws-infra
13251325
Image: aws/codebuild/amazonlinux2-x86_64-standard:5.0
13261326
ImagePullCredentialsType: CODEBUILD
13271327
PrivilegedMode: false
@@ -1563,13 +1563,13 @@ Resources:
15631563
Fn::GetAtt:
15641564
- CodeBuildStartLambdaFunction8349284F
15651565
- Arn
1566-
ContentHash: "1766581150709"
15671566
ProjectName:
15681567
Ref: CodeBuildProjectA0FF5539
15691568
CodeBuildIamRoleArn:
15701569
Fn::GetAtt:
15711570
- CodeBuildRoleE9A44575
15721571
- Arn
1572+
ContentHash: "1766599121094"
15731573
DependsOn:
15741574
- CodeBuildCompleteRuleAllowEventRuleWorkshopStackCodeBuildReportLambdaFunctionD77C60919E0B0C89
15751575
- CodeBuildCompleteRuleEE9277E8
@@ -1921,7 +1921,7 @@ Resources:
19211921
- Ref: AWS::AccountId
19221922
- "-"
19231923
- Ref: AWS::Region
1924-
- "-20251224135910"
1924+
- "-20251224185841"
19251925
PublicAccessBlockConfiguration:
19261926
BlockPublicAcls: true
19271927
BlockPublicPolicy: true
@@ -2187,15 +2187,15 @@ Resources:
21872187
}
21882188
Environment:
21892189
Variables:
2190-
KUBERNETES_AUTH_TYPE: aws
2191-
APP_LABEL: unicorn-store-spring
2192-
K8S_NAMESPACE: unicorn-store-spring
21932190
S3_THREAD_DUMPS_PREFIX: thread-dumps/
21942191
EKS_CLUSTER_NAME:
21952192
Ref: EksClusterB2BDED5B
21962193
S3_BUCKET_NAME:
21972194
Ref: WorkshopBucketFD5BC43F
21982195
SECRET_NAME: workshop-ide-password
2196+
KUBERNETES_AUTH_TYPE: aws
2197+
APP_LABEL: unicorn-store-spring
2198+
K8S_NAMESPACE: unicorn-store-spring
21992199
FunctionName: workshop-thread-dump-lambda
22002200
Handler: index.lambda_handler
22012201
MemorySize: 512
@@ -3042,7 +3042,7 @@ Outputs:
30423042
Export:
30433043
Name: ide-password
30443044
Parameters:
3045-
SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61arm64C96584B6F00A464EAD1953AFF4B05118Parameter:
3045+
SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter:
30463046
Type: AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>
3047-
Default: /aws/service/ami-amazon-linux-latest/al2023-ami-kernel-6.1-arm64
3047+
Default: /aws/service/ami-amazon-linux-latest/al2023-ami-kernel-6.1-x86_64
30483048

0 commit comments

Comments
 (0)