Skip to content

Commit 2823523

Browse files
committed
Fix 018-ecs-ec2: heredoc 'EOF' → EOF for variable expansion. Add 000-prereqs-directory CFN stack.
018: user data had literal $CLUSTER_NAME instead of the actual cluster name. Single-quoted heredoc prevented variable expansion. Passes locally. 000-prereqs-directory: Simple AD for WorkSpaces tutorials. Deployed.
1 parent 609dbe6 commit 2823523

2 files changed

Lines changed: 40 additions & 1 deletion

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
AWSTemplateFormatVersion: '2010-09-09'
2+
Description: 'Prereq: Simple AD directory for WorkSpaces tutorials. Uses default VPC.'
3+
4+
Parameters:
5+
DirectoryName:
6+
Type: String
7+
Default: corp.example.com
8+
DirectorySize:
9+
Type: String
10+
Default: Small
11+
AllowedValues: [Small, Large]
12+
VpcId:
13+
Type: AWS::EC2::VPC::Id
14+
Description: VPC for the directory (use default VPC)
15+
SubnetId1:
16+
Type: AWS::EC2::Subnet::Id
17+
Description: First subnet (must be in a different AZ from SubnetId2)
18+
SubnetId2:
19+
Type: AWS::EC2::Subnet::Id
20+
Description: Second subnet (must be in a different AZ from SubnetId1)
21+
22+
Resources:
23+
Directory:
24+
Type: AWS::DirectoryService::SimpleAD
25+
Properties:
26+
Name: !Ref DirectoryName
27+
Password: 'TutorialPass123!'
28+
Size: !Ref DirectorySize
29+
VpcSettings:
30+
VpcId: !Ref VpcId
31+
SubnetIds:
32+
- !Ref SubnetId1
33+
- !Ref SubnetId2
34+
35+
Outputs:
36+
DirectoryId:
37+
Value: !Ref Directory
38+
Export:
39+
Name: !Sub '${AWS::StackName}-DirectoryId'

tuts/018-ecs-ec2/ecs-ec2-getting-started.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ launch_container_instance() {
343343
log "Launching ECS container instance..."
344344

345345
# Create user data script
346-
cat > ecs-user-data.sh << 'EOF'
346+
cat > ecs-user-data.sh << EOF
347347
#!/bin/bash
348348
echo ECS_CLUSTER=$CLUSTER_NAME >> /etc/ecs/ecs.config
349349
EOF

0 commit comments

Comments
 (0)