From e2fb0d13f6e7b4b78f0563524a4933e8c57c89cc Mon Sep 17 00:00:00 2001 From: Andrew Gargan Date: Wed, 19 Oct 2022 10:17:29 -0700 Subject: [PATCH] Small revision for blog assets. --- .../templates/eks-cluster-prework.template.yaml | 13 +------------ .../templates/prework.template.yaml | 7 +++---- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/blog-assets/eks-cluster-prework/templates/eks-cluster-prework.template.yaml b/blog-assets/eks-cluster-prework/templates/eks-cluster-prework.template.yaml index 58571d2..a27fdef 100644 --- a/blog-assets/eks-cluster-prework/templates/eks-cluster-prework.template.yaml +++ b/blog-assets/eks-cluster-prework/templates/eks-cluster-prework.template.yaml @@ -6,7 +6,7 @@ Parameters: Type: String JobName: Type: String - Default: 'job-example' + Default: 'example-job' AvailabilityZones: Description: List of Availability Zones to use for the subnets in the VPC. Three Availability Zones are used for this deployment. @@ -38,12 +38,6 @@ Resources: NodeInstanceType: t3.large NumberOfNodes: 1 MaxNumberOfNodes: 1 - GetOIDCProvider: - Type: Custom::GetOIDCProvider - Properties: - ServiceToken: !Sub "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:eks-quickstart-ResourceReader" - AwsCliCommand: !Sub "eks describe-cluster --name ${EKSStack.Outputs.EKSClusterName} --query 'cluster.identity.oidc.{issuer:issuer}'" - IdField: 'issuer' PreworkStack: Type: AWS::CloudFormation::Stack Properties: @@ -54,11 +48,6 @@ Resources: PreworkScriptObject: !Ref PreworkScriptObject JobName: !Ref JobName KubernetesNameSpace: "prework-example" - OIDCProvider: !Sub - - "${OIDCProvider1}/${OIDCProvider2}/${OIDCProvider3}" - - OIDCProvider1: !Select [ 2, !Split [ "/", !Ref GetOIDCProvider ] ] - OIDCProvider2: !Select [ 3, !Split [ "/", !Ref GetOIDCProvider ] ] - OIDCProvider3: !Select [ 4, !Split [ "/", !Ref GetOIDCProvider ] ] Outputs: EKSClusterName: Value: !GetAtt EKSStack.Outputs.EKSClusterName diff --git a/blog-assets/eks-cluster-prework/templates/prework.template.yaml b/blog-assets/eks-cluster-prework/templates/prework.template.yaml index b268e54..5aa919f 100644 --- a/blog-assets/eks-cluster-prework/templates/prework.template.yaml +++ b/blog-assets/eks-cluster-prework/templates/prework.template.yaml @@ -11,7 +11,7 @@ Parameters: Default: "quickstart-examples/samples/eks-cluster-prework/scripts/pw-script.sh" JobName: Type: String - Default: job-example + Default: example-job AllowedPattern: '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*' ConstraintDescription: "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric @@ -45,6 +45,7 @@ Resources: } - NameSpace: !Ref KubernetesNameSpace ResourceName: !Sub "pw-service-account-${JobName}" + OIDCProvider: !Join [ '', !Split [ 'https://', !Ref 'GetOIDCProvider' ] ] Path: "/" Policies: - PolicyName: root @@ -166,8 +167,6 @@ Resources: args: - > sleep 15; - yum update -y; - yum install -y awscli; export AWS_REGION=${AWS::Region}; export NS=${NameSpace}; aws sts get-caller-identity; @@ -186,4 +185,4 @@ Resources: backoffLimit: 4 - ResourceName: !Sub "pw-job-${JobName}" NameSpace: !Ref "KubernetesNameSpace" - S3ScriptURL: !Sub "s3://${PreworkScriptBucket}/${PreworkScriptObject}" \ No newline at end of file + S3ScriptURL: !Sub "s3://${PreworkScriptBucket}/${PreworkScriptObject}"