Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Commit 782d101

Browse files
authored
Merge pull request #66 from aws-quickstart/gargana_blog_assets
Final changes for blog assets
2 parents b1cdf83 + 9c55e7a commit 782d101

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

blog-assets/eks-cluster-prework/templates/eks-cluster-prework.template.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@ Parameters:
44
AccessCIDR:
55
Default: 0.0.0.0/0
66
Type: String
7+
KeyPairName:
8+
Description: Name of an existing key pair, which allows you to securely connect to your bastion instance after it launches.
9+
Leave empty to proceed without a key pair. You would need to use AWS Systems Manager Session Manager to connect to the provisioned EC2 instances.
10+
Type: String
11+
Default: ""
712
JobName:
813
Type: String
914
Default: 'example-job'
1015
AvailabilityZones:
1116
Description: List of Availability Zones to use for the subnets in the VPC. Three
1217
Availability Zones are used for this deployment.
13-
Type: List<AWS::EC2::AvailabilityZone::Name> AvailabilityZones:
18+
Type: List<AWS::EC2::AvailabilityZone::Name>
1419
NumberOfAZs:
1520
Type: String
1621
AllowedValues: ["2", "3"]
@@ -28,22 +33,22 @@ Resources:
2833
Properties:
2934
TemplateURL: 'https://aws-quickstart.s3.amazonaws.com/quickstart-amazon-eks/templates/amazon-eks-entrypoint-new-vpc.template.yaml'
3035
Parameters:
31-
# QuickStart properties
32-
QSS3BucketName: aws-quickstart
33-
QSS3KeyPrefix: quickstart-amazon-eks/
3436
# Cluster properties
3537
ProvisionBastionHost: Enabled
38+
KeyPairName: !Ref KeyPairName
3639
RemoteAccessCIDR: !Ref AccessCIDR
3740
AvailabilityZones: !Join [ ',', !Ref 'AvailabilityZones' ]
41+
NumberOfAZs: !Ref NumberOfAZs
3842
NodeInstanceType: t3.large
3943
NumberOfNodes: 1
4044
MaxNumberOfNodes: 1
4145
PreworkStack:
46+
DependsOn: EKSStack
4247
Type: AWS::CloudFormation::Stack
4348
Properties:
4449
TemplateURL: 'https://aws-quickstart.s3.amazonaws.com/quickstart-examples/blog-assets/eks-cluster-prework/templates/prework.template.yaml'
4550
Parameters:
46-
ClusterName: !Sub "EKSStack.Outputs.EKSClusterName"
51+
ClusterName: !GetAtt "EKSStack.Outputs.EKSClusterName"
4752
PreworkScriptBucket: !Ref PreworkScriptBucket
4853
PreworkScriptObject: !Ref PreworkScriptObject
4954
JobName: !Ref JobName

blog-assets/eks-cluster-prework/templates/prework.template.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Parameters:
88
Default: aws-quickstart
99
PreworkScriptObject:
1010
Type: String
11-
Default: "quickstart-examples/samples/eks-cluster-prework/scripts/pw-script.sh"
11+
Default: "quickstart-examples/blog-assets/eks-cluster-prework/scripts/pw-script.sh"
1212
JobName:
1313
Type: String
1414
Default: example-job
@@ -32,12 +32,12 @@ Resources:
3232
{
3333
"Effect": "Allow",
3434
"Principal": {
35-
"Federated": "arn:aws:iam::${AWS::AccountId}:oidc-provider/${GetOIDCProvider}"
35+
"Federated": "arn:aws:iam::${AWS::AccountId}:oidc-provider/${OIDCProvider}"
3636
},
3737
"Action": "sts:AssumeRoleWithWebIdentity",
3838
"Condition": {
3939
"StringEquals": {
40-
"${GetOIDCProvider}:sub": "system:serviceaccount:${NameSpace}:${ResourceName}"
40+
"${OIDCProvider}:sub": "system:serviceaccount:${NameSpace}:${ResourceName}"
4141
}
4242
}
4343
}
@@ -169,6 +169,7 @@ Resources:
169169
sleep 15;
170170
export AWS_REGION=${AWS::Region};
171171
export NS=${NameSpace};
172+
yum install -y aws-cli;
172173
aws sts get-caller-identity;
173174
aws s3 cp ${!S3_SCRIPT_URL} ./prework-script.sh &&
174175
chmod +x ./prework-script.sh &&

0 commit comments

Comments
 (0)