Skip to content

Commit 4bbd252

Browse files
author
Yuriy
committed
chore(java-on-aws): rename immersion day references to generic workshop naming
1 parent f852e3f commit 4bbd252

21 files changed

Lines changed: 132 additions & 43 deletions

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ jobs:
3838
run: npm install -g aws-cdk
3939
- name: AWS CDK version
4040
run: cdk version
41-
- name: Build CDK Immersion Day infrastructure
41+
- name: Build CDK infrastructure
4242
run: mvn clean package --no-transfer-progress
4343
working-directory: ./infrastructure/cdk/
44-
- name: CDK Synth Immersion Day infrastructure
44+
- name: CDK Synth infrastructure
4545
run: cdk synth
4646
working-directory: ./infrastructure/cdk/
4747
- name: Build unicorn-store-wildfly with Docker

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Java on AWS Immersion Day
1+
# Java on AWS
22

33
![Java on AWS](resources/welcome.png)
44

5-
This project contains the supporting code for the Java on AWS Immersion Day. You can find the instructions for the hands-on lab [here](https://catalog.workshops.aws/java-on-aws).
5+
This project contains the supporting code for the Java on AWS. You can find the instructions for the hands-on lab [here](https://catalog.workshops.aws/java-on-aws).
66

77
# Overview
88
In this workshop you will learn how to build cloud-native Java applications, best practices and performance optimizations techniques. You will also learn how to migrate your existing Java application to container services such as AWS AppRunner, Amazon ECS and Amazon EKS or how to to run them as Serverless AWS Lambda functions.

infra/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ infra/
5353
│ └── cdk.json # CDK configuration
5454
├── cfn/ # Generated CloudFormation templates
5555
│ ├── base-stack.yaml
56-
│ ├── java-on-aws-immersion-day-stack.yaml
56+
│ ├── java-on-aws-stack.yaml
5757
│ ├── java-on-amazon-eks-stack.yaml
5858
│ └── java-spring-ai-agents-stack.yaml
5959
├── scripts/
@@ -68,7 +68,7 @@ infra/
6868
│ │ └── shell-p10k.zsh # Powerlevel10k config
6969
│ ├── templates/ # Workshop-specific post-deploy scripts
7070
│ │ ├── base.sh
71-
│ │ ├── java-on-aws-immersion-day.sh
71+
│ │ ├── java-on-aws.sh
7272
│ │ ├── java-on-amazon-eks.sh
7373
│ │ └── java-spring-ai-agents.sh
7474
│ ├── setup/ # Infrastructure setup scripts
@@ -96,8 +96,8 @@ infra/
9696
| Template Type | Resources Created |
9797
|---------------|-------------------|
9898
| `base` | VPC, IDE |
99-
| `java-on-aws-immersion-day` | VPC, IDE, CodeBuild, Database, EKS, WorkshopBucket, EcrRegistry, Unicorn, ECR (unicorn-store-spring), ThreadAnalysis, AiJvmAnalyzer |
100-
| `java-on-amazon-eks` | Same as java-on-aws-immersion-day |
99+
| `java-on-aws` | VPC, IDE, CodeBuild, Database, EKS, WorkshopBucket, EcrRegistry, Unicorn, ECR (unicorn-store-spring), ThreadAnalysis, AiJvmAnalyzer |
100+
| `java-on-amazon-eks` | Same as java-on-aws |
101101
| `java-spring-ai-agents` | VPC, IDE, CodeBuild, Database, EKS, WorkshopBucket, EcrRegistry, Unicorn, 2x EcsExpressService (unicorn-spring-ai-agent, unicorn-store-spring) |
102102

103103
---
@@ -215,10 +215,10 @@ public WorkshopStack(...) {
215215
String prefix = "workshop";
216216
String templateType = getContext("template.type"); // defaults to "base"
217217

218-
boolean isImmersionDay = "java-on-aws-immersion-day".equals(templateType);
218+
boolean isJavaOnAws = "java-on-aws".equals(templateType);
219219
boolean isEks = "java-on-amazon-eks".equals(templateType);
220220
boolean isSpringAi = "java-spring-ai-agents".equals(templateType);
221-
boolean isFullTemplate = isImmersionDay || isEks || isSpringAi;
221+
boolean isFullTemplate = isJavaOnAws || isEks || isSpringAi;
222222

223223
// Always created
224224
Vpc vpc = new Vpc(this, "Vpc", ...);
@@ -231,8 +231,8 @@ public WorkshopStack(...) {
231231
Eks eks = new Eks(...);
232232
Unicorn unicorn = new Unicorn(...); // EventBus, EKS/ECS roles, DB setup
233233

234-
// java-on-aws-immersion-day & java-on-amazon-eks only
235-
if (isImmersionDay || isEks) {
234+
// java-on-aws & java-on-amazon-eks only
235+
if (isJavaOnAws || isEks) {
236236
new Repository("unicorn-store-spring"); // ECR for manual deployment
237237
new ThreadAnalysis(...);
238238
new AiJvmAnalyzer(...);

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ public WorkshopStack(final Construct scope, final String id, final StackProps pr
5353
}
5454

5555
// Template type flags
56-
boolean isImmersionDay = "java-on-aws-immersion-day".equals(templateType);
56+
boolean isJavaOnAws = "java-on-aws".equals(templateType);
5757
boolean isEks = "java-on-amazon-eks".equals(templateType);
5858
boolean isSpringAi = "java-spring-ai-agents".equals(templateType);
5959
boolean isAiAgents = "java-ai-agents".equals(templateType);
6060
boolean isAiAgentsAdvanced = "java-ai-agents-advanced".equals(templateType);
61-
boolean isFullTemplate = isImmersionDay || isEks || isSpringAi;
61+
boolean isFullTemplate = isJavaOnAws || isEks || isSpringAi;
6262
boolean needsDatabase = isFullTemplate;
6363

6464
// Core infrastructure (always created)
@@ -122,7 +122,7 @@ public WorkshopStack(final Construct scope, final String id, final StackProps pr
122122
))
123123
.build();
124124

125-
// Full template resources (java-on-aws-immersion-day, java-on-amazon-eks, java-spring-ai-agents)
125+
// Full template resources (java-on-aws, java-on-amazon-eks, java-spring-ai-agents)
126126
// or java-ai-agents (database only)
127127
Database database = null;
128128
if (needsDatabase) {
@@ -149,8 +149,8 @@ public WorkshopStack(final Construct scope, final String id, final StackProps pr
149149
.workshopBucket(workshopBucket.getBucket())
150150
.build());
151151

152-
// java-on-aws-immersion-day & java-on-amazon-eks specific resources
153-
if (isImmersionDay || isEks) {
152+
// java-on-aws & java-on-amazon-eks specific resources
153+
if (isJavaOnAws || isEks) {
154154
// ECR repository for unicorn-store-spring (manual ECS Express deployment)
155155
Repository.Builder.create(this, "UnicornStoreSpringEcr")
156156
.repositoryName("unicorn-store-spring")

infra/cfn/java-on-aws-immersion-day-stack.yaml renamed to infra/cfn/java-on-aws-stack.yaml

Lines changed: 86 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ Resources:
422422
Fn::GetAtt:
423423
- CodeBuildRoleE9A44575
424424
- Arn
425-
ContentHash: "1768809143448"
425+
ContentHash: "1774370017491"
426426
ProjectName:
427427
Ref: CodeBuildProjectA0FF5539
428428
ServiceToken:
@@ -511,7 +511,7 @@ Resources:
511511
EnvironmentVariables:
512512
- Name: TEMPLATE_TYPE
513513
Type: PLAINTEXT
514-
Value: java-on-aws-immersion-day
514+
Value: java-on-aws
515515
- Name: GIT_BRANCH
516516
Type: PLAINTEXT
517517
Value: main
@@ -543,6 +543,8 @@ Resources:
543543
# Resolution for when creating the first service in the account
544544
aws iam create-service-linked-role --aws-service-name ecs.amazonaws.com 2>/dev/null || true
545545
aws iam create-service-linked-role --aws-service-name elasticloadbalancing.amazonaws.com 2>/dev/null || true
546+
aws iam create-service-linked-role --aws-service-name network.bedrock-agentcore.amazonaws.com 2>/dev/null || true
547+
aws iam create-service-linked-role --aws-service-name runtime-identity.bedrock-agentcore.amazonaws.com 2>/dev/null || true
546548
Type: NO_SOURCE
547549
TimeoutInMinutes: 30
548550
VpcConfig:
@@ -1362,7 +1364,7 @@ Resources:
13621364
- Ref: AWS::Region
13631365
- |-
13641366
"
1365-
export TEMPLATE_TYPE="java-on-aws-immersion-day"
1367+
export TEMPLATE_TYPE="java-on-aws"
13661368
export ARCH="x86_64"
13671369
export IDE_TYPE="code-editor"
13681370
export WAIT_CONDITION_HANDLE_URL="
@@ -2008,14 +2010,15 @@ Resources:
20082010
Condition:
20092011
ForAllValues:StringEquals:
20102012
aws-marketplace:ProductId:
2011-
- prod-jhuafngbly644
2013+
- prod-xdkflymybwmvi
20122014
- prod-mxcfnwvpd6kb4
2015+
- prod-jhuafngbly644
20132016
- prod-4pmewlybdftbs
20142017
"Null":
20152018
aws-marketplace:ProductId: "false"
20162019
Effect: Allow
20172020
Resource: "*"
2018-
Sid: MarketplaceSubscribeClaude45Opus45Sonnet4Sonnet
2021+
Sid: MarketplaceSubscribeClaude
20192022
- Action:
20202023
- acm:*
20212024
- apigateway:*
@@ -2031,6 +2034,8 @@ Resources:
20312034
- cloudwatch:*
20322035
- codewhisperer:*
20332036
- cognito-idp:*
2037+
- dbqms:*
2038+
- dynamodb:*
20342039
- ec2:*
20352040
- ecr:*
20362041
- ecs:*
@@ -2040,6 +2045,7 @@ Resources:
20402045
- lambda:*
20412046
- logs:*
20422047
- q:*
2048+
- rds-data:*
20432049
- rds:*
20442050
- s3:*
20452051
- s3vectors:*
@@ -2069,10 +2075,42 @@ Resources:
20692075
Sid: CreateServiceLinkedRole
20702076
- Action:
20712077
- iam:GetRole
2078+
- iam:ListAttachedRolePolicies
2079+
- iam:ListRolePolicies
20722080
- iam:ListRoles
20732081
Effect: Allow
20742082
Resource: "*"
20752083
Sid: GetRole
2084+
- Action:
2085+
- iam:AttachRolePolicy
2086+
- iam:CreateRole
2087+
- iam:DeleteRole
2088+
- iam:DeleteRolePolicy
2089+
- iam:DetachRolePolicy
2090+
- iam:PutRolePolicy
2091+
- iam:UpdateAssumeRolePolicy
2092+
Condition:
2093+
StringEquals:
2094+
iam:PermissionsBoundary: !Sub arn:aws:iam::${AWS::AccountId}:policy/workshop-boundary
2095+
Effect: Allow
2096+
Resource:
2097+
- !Sub arn:aws:iam::${AWS::AccountId}:role/aiagent*
2098+
- !Sub arn:aws:iam::${AWS::AccountId}:role/backoffice*
2099+
- !Sub arn:aws:iam::${AWS::AccountId}:role/mcp*
2100+
Sid: AiAgentCreateRoles
2101+
- Action: iam:PassRole
2102+
Condition:
2103+
StringEquals:
2104+
iam:PassedToService:
2105+
- bedrock.amazonaws.com
2106+
- bedrock-agentcore.amazonaws.com
2107+
- lambda.amazonaws.com
2108+
Effect: Allow
2109+
Resource:
2110+
- !Sub arn:aws:iam::${AWS::AccountId}:role/aiagent*
2111+
- !Sub arn:aws:iam::${AWS::AccountId}:role/backoffice*
2112+
- !Sub arn:aws:iam::${AWS::AccountId}:role/mcp*
2113+
Sid: AiAgentPassRole
20762114
- Action: ec2:RunInstances
20772115
Condition:
20782116
StringLike:
@@ -2116,6 +2154,48 @@ Resources:
21162154
Type: AWS::CloudFormation::WaitCondition
21172155
IdeWaitConditionHandleE8345861:
21182156
Type: AWS::CloudFormation::WaitConditionHandle
2157+
IdeWorkshopBoundaryDEE72AD4:
2158+
Properties:
2159+
Description: ""
2160+
ManagedPolicyName: workshop-boundary
2161+
Path: /
2162+
PolicyDocument:
2163+
Statement:
2164+
- Action:
2165+
- aws-marketplace:Subscribe
2166+
- aws-marketplace:Unsubscribe
2167+
- aws-marketplace:ViewSubscriptions
2168+
- bedrock-agentcore:*
2169+
- bedrock:*
2170+
- cloudfront:*
2171+
- cloudwatch:*
2172+
- cognito-idp:*
2173+
- dynamodb:*
2174+
- ec2:CreateNetworkInterface
2175+
- ec2:DeleteNetworkInterface
2176+
- ec2:DescribeNetworkInterfaces
2177+
- ec2:DescribeSecurityGroups
2178+
- ec2:DescribeSubnets
2179+
- ec2:DescribeVpcs
2180+
- ecr:*
2181+
- lambda:InvokeFunction
2182+
- logs:*
2183+
- s3:*
2184+
- s3vectors:*
2185+
- secretsmanager:GetSecretValue
2186+
- xray:*
2187+
Effect: Allow
2188+
Resource: "*"
2189+
Sid: AllowedServicesForRoles
2190+
- Action:
2191+
- account:*
2192+
- iam:*
2193+
- organizations:*
2194+
Effect: Deny
2195+
Resource: "*"
2196+
Sid: DenyIAM
2197+
Version: "2012-10-17"
2198+
Type: AWS::IAM::ManagedPolicy
21192199
ThreadAnalysisLambda3EE9B29D:
21202200
DependsOn:
21212201
- ThreadAnalysisLambdaRoleDefaultPolicyC7AD40BA
@@ -3110,7 +3190,7 @@ Resources:
31103190
- Ref: AWS::AccountId
31113191
- "-"
31123192
- Ref: AWS::Region
3113-
- "-20260119085223"
3193+
- "-20260324173337"
31143194
PublicAccessBlockConfiguration:
31153195
BlockPublicAcls: true
31163196
BlockPublicPolicy: true

infra/scripts/cfn/generate.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cd "$(dirname "$0")/../../cdk" || {
1313
echo ""
1414
echo "Select template to generate:"
1515
echo " 0) All templates"
16-
echo " 1) java-on-aws-immersion-day"
16+
echo " 1) java-on-aws"
1717
echo " 2) java-on-amazon-eks"
1818
echo " 3) java-spring-ai-agents"
1919
echo " 4) java-ai-agents"
@@ -23,8 +23,8 @@ read -p "Enter choice [0-5]: " choice
2323

2424
# Determine which templates to generate
2525
case $choice in
26-
0) templates=("java-on-aws-immersion-day" "java-on-amazon-eks" "java-spring-ai-agents" "java-ai-agents" "java-ai-agents-advanced") ;;
27-
1) templates=("java-on-aws-immersion-day") ;;
26+
0) templates=("java-on-aws" "java-on-amazon-eks" "java-spring-ai-agents" "java-ai-agents" "java-ai-agents-advanced") ;;
27+
1) templates=("java-on-aws") ;;
2828
2) templates=("java-on-amazon-eks") ;;
2929
3) templates=("java-spring-ai-agents") ;;
3030
4) templates=("java-ai-agents") ;;

infra/scripts/cfn/sync.sh

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ cd "$SCRIPT_DIR/../.." || {
1414
exit 1
1515
}
1616

17-
WORKSHOPS=("java-on-aws-immersion-day" "java-on-amazon-eks" "java-spring-ai-agents" "java-ai-agents" "java-ai-agents-advanced")
17+
WORKSHOPS=("java-on-aws" "java-on-amazon-eks" "java-spring-ai-agents" "java-ai-agents" "java-ai-agents-advanced")
1818

1919
# Shared IAM policy file used by all workshops
2020
SHARED_POLICY_FILE="cdk/src/main/resources/iam-policy.json"
@@ -28,7 +28,7 @@ fi
2828
echo ""
2929
echo "Select template to sync:"
3030
echo " 0) All templates"
31-
echo " 1) java-on-aws-immersion-day"
31+
echo " 1) java-on-aws"
3232
echo " 2) java-on-amazon-eks"
3333
echo " 3) java-spring-ai-agents"
3434
echo " 4) java-ai-agents"
@@ -39,7 +39,7 @@ read -p "Enter choice [0-5]: " choice
3939
# Determine which workshops to sync
4040
case $choice in
4141
0) selected_workshops=("${WORKSHOPS[@]}") ;;
42-
1) selected_workshops=("java-on-aws-immersion-day") ;;
42+
1) selected_workshops=("java-on-aws") ;;
4343
2) selected_workshops=("java-on-amazon-eks") ;;
4444
3) selected_workshops=("java-spring-ai-agents") ;;
4545
4) selected_workshops=("java-ai-agents") ;;
@@ -54,9 +54,18 @@ log_info "Syncing CloudFormation templates and policies to workshop directories.
5454

5555
synced_count=0
5656

57+
# Map template name to actual folder name (when they differ)
58+
get_folder_name() {
59+
case "$1" in
60+
"java-on-aws") echo "java-on-aws-immersion-day" ;;
61+
*) echo "$1" ;;
62+
esac
63+
}
64+
5765
for workshop in "${selected_workshops[@]}"; do
58-
# Target is sibling to repo root: ../../{workshop}/static
59-
target_dir="../../$workshop/static"
66+
# Target is sibling to repo root: ../../{folder}/static
67+
folder_name=$(get_folder_name "$workshop")
68+
target_dir="../../$folder_name/static"
6069

6170
if [[ -d "$target_dir" ]]; then
6271
# Copy workshop-specific CloudFormation template -> workshop-stack.yaml
@@ -66,7 +75,7 @@ for workshop in "${selected_workshops[@]}"; do
6675
log_error "Failed to copy template for $workshop"
6776
exit 1
6877
}
69-
log_success "Synced $template_file to $workshop/static/workshop-stack.yaml"
78+
log_success "Synced $template_file to $folder_name/static/workshop-stack.yaml"
7079
else
7180
log_error "Template file $template_file not found"
7281
exit 1
@@ -77,11 +86,11 @@ for workshop in "${selected_workshops[@]}"; do
7786
log_error "Failed to copy policy for $workshop"
7887
exit 1
7988
}
80-
log_success "Synced $SHARED_POLICY_FILE to $workshop/static/iam-policy.json"
89+
log_success "Synced $SHARED_POLICY_FILE to $folder_name/static/iam-policy.json"
8190

8291
((synced_count++))
8392
else
84-
log_info "Directory $target_dir not found, skipping $workshop"
93+
log_info "Directory $target_dir not found, skipping $workshop ($folder_name)"
8594
fi
8695
done
8796

infra/scripts/deploy/java-on-aws-immersion-day/1-containerize.sh renamed to infra/scripts/deploy/java-on-aws/1-containerize.sh

File renamed without changes.
File renamed without changes.

infra/scripts/deploy/java-on-aws-immersion-day/3-ecs-express.sh renamed to infra/scripts/deploy/java-on-aws/3-ecs-express.sh

File renamed without changes.

0 commit comments

Comments
 (0)