+ License:
+ Description: 'Copyright 2020 Amazon.com, Inc. and its affiliates. All Rights Reserved.
+
+ Licensed under the Amazon Software License (the "License"). You may not use this file
+ except in compliance with the License. A copy of the License is located at
+
+ http://aws.amazon.com/asl/
+
+ or in the "license" file accompanying this file. This file is distributed on an "AS IS"
+ BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ License for the specific language governing permissions and limitations under the License.'
+
+Parameters:
+ C9InstanceType:
+ Description: Example Cloud9 instance type
+ Type: String
+ Default: t3.small
+ AllowedValues:
+ - t3.small
+ - t3.medium
+ ConstraintDescription: Must be a valid Cloud9 instance type
+ C9KubectlVersion:
+ Description: Cloud9 instance kubectl version
+ Type: String
+ Default: v1.18.12
+ ConstraintDescription: Must be a valid kubectl version
+ C9KubectlVersionTEST:
+ Description: Cloud9 instance kubectl version
+ Type: String
+ Default: v1.18.12
+ ConstraintDescription: Must be a valid kubectl version
+ C9EKSctlVersion:
+ Description: Cloud9 instance eksctl version
+ Type: String
+ Default: 0.31.0
+ ConstraintDescription: Must be a valid eksctl version
+ EKSClusterVersion:
+ Description: EKS Cluster Vesion
+ Type: String
+ Default: 1.18
+ ConstraintDescription: Must be a valid eks version
+ EKSClusterName:
+ Description: EKS Cluster Name
+ Type: String
+ Default: eksworkshop-eksctl
+ ConstraintDescription: Must be a valid eks version
+ #Used only by Event Engine, if you are self-deploying the stack leave the default value to NONE
+ EETeamRoleArn:
+ Description: "ARN of the Team Role"
+ Default: NONE
+ Type: String
+ ConstraintDescription: This is ONLY used Event Engine, dont change this if you are self-deploying the stack
+
+Conditions:
+ NotEventEngine: !Equals [!Ref EETeamRoleArn, NONE]
+
+Resources:
+
+################## PERMISSIONS AND ROLES #################
+ C9Role:
+ Type: AWS::IAM::Role
+ Condition: NotEventEngine
+ Properties:
+ Tags:
+ - Key: Environment
+ Value: AWS Example
+ AssumeRolePolicyDocument:
+ Version: '2012-10-17'
+ Statement:
+ - Effect: Allow
+ Principal:
+ Service:
+ - ec2.amazonaws.com
+ - ssm.amazonaws.com
+ Action:
+ - sts:AssumeRole
+ ManagedPolicyArns:
+ - arn:aws:iam::aws:policy/AdministratorAccess
+ Path: "/"
+ C9LambdaExecutionRole:
+ Type: AWS::IAM::Role
+ Properties:
+ AssumeRolePolicyDocument:
+ Version: '2012-10-17'
+ Statement:
+ - Effect: Allow
+ Principal:
+ Service:
+ - lambda.amazonaws.com
+ Action:
+ - sts:AssumeRole
+ Path: "/"
+ Policies:
+ - PolicyName:
+ Fn::Join:
+ - ''
+ - - C9LambdaPolicy-
+ - Ref: AWS::Region
+ PolicyDocument:
+ Version: '2012-10-17'
+ Statement:
+ - Effect: Allow
+ Action:
+ - logs:CreateLogGroup
+ - logs:CreateLogStream
+ - logs:PutLogEvents
+ Resource: arn:aws:logs:*:*:*
+ - Effect: Allow
+ Action:
+ - cloudformation:DescribeStacks
+ - cloudformation:DescribeStackEvents
+ - cloudformation:DescribeStackResource
+ - cloudformation:DescribeStackResources
+ - ec2:DescribeInstances
+ - ec2:AssociateIamInstanceProfile
+ - ec2:ModifyInstanceAttribute
+ - ec2:ReplaceIamInstanceProfileAssociation
+ - iam:ListInstanceProfiles
+ - iam:PassRole
+ Resource: "*"
+
+################## LAMBDA BOOTSTRAP FUNCTION ################
+
+ C9BootstrapInstanceLambda:
+ Description: Bootstrap Cloud9 instance
+ Type: Custom::C9BootstrapInstanceLambda
+ DependsOn:
+ - C9BootstrapInstanceLambdaFunction
+ - C9Instance
+ - C9LambdaExecutionRole
+ Properties:
+ Tags:
+ - Key: Environment
+ Value: AWS Example
+ ServiceToken:
+ Fn::GetAtt:
+ - C9BootstrapInstanceLambdaFunction
+ - Arn
+ REGION:
+ Ref: AWS::Region
+ StackName:
+ Ref: AWS::StackName
+ EnvironmentId:
+ Ref: C9Instance
+ LabIdeInstanceProfileArn: !If [ NotEventEngine, !GetAtt C9InstanceProfile.Arn, !Sub 'arn:aws:iam::${AWS::AccountId}:instance-profile/TeamRoleInstanceProfile' ]
+
+ C9BootstrapInstanceLambdaFunction:
+ Type: AWS::Lambda::Function
+ Properties:
+ Tags:
+ - Key: Environment
+ Value: AWS Example
+ Handler: index.lambda_handler
+ Role:
+ Fn::GetAtt:
+ - C9LambdaExecutionRole
+ - Arn
+ Runtime: python3.6
+ MemorySize: 256
+ Timeout: '600'
+ Code:
+ ZipFile: |
+ from __future__ import print_function
+ import boto3
+ # import loggings
+ import json
+ import os
+ import time
+ import traceback
+ import cfnresponse
+
+ # logger = logging.getLogger()
+ # logger.setLevel(logging.INFO)
+
+ def lambda_handler(event, context):
+ # logger.info('event: {}'.format(event))
+ # logger.info('context: {}'.format(context))
+ responseData = {}
+
+ if event['RequestType'] == 'Create':
+ try:
+ # Open AWS clients
+ ec2 = boto3.client('ec2')
+
+ # Get the InstanceId of the Cloud9 IDE
+ # print(str({'Name': 'tag:aws:cloud9:environment','Values': [event['ResourceProperties']['EnvironmentId']]}))
+ instance = ec2.describe_instances(Filters=[{'Name': 'tag:aws:cloud9:environment','Values': [event['ResourceProperties']['EnvironmentId']]}])['Reservations'][0]['Instances'][0]
+ # logger.info('instance: {}'.format(instance))
+
+ # Create the IamInstanceProfile request object
+ iam_instance_profile = {
+ 'Arn': event['ResourceProperties']['LabIdeInstanceProfileArn']
+ }
+ # logger.info('iam_instance_profile: {}'.format(iam_instance_profile))
+
+ # Wait for Instance to become ready before adding Role
+ instance_state = instance['State']['Name']
+ # logger.info('instance_state: {}'.format(instance_state))
+ while instance_state != 'running':
+ time.sleep(5)
+ instance_state = ec2.describe_instances(InstanceIds=[instance['InstanceId']])
+ # logger.info('instance_state: {}'.format(instance_state))
+
+ # attach instance profile
+ response = ec2.associate_iam_instance_profile(IamInstanceProfile=iam_instance_profile, InstanceId=instance['InstanceId'])
+ # logger.info('response - associate_iam_instance_profile: {}'.format(response))
+ r_ec2 = boto3.resource('ec2')
+
+ responseData = {'Success': 'Started bootstrapping for instance: '+instance['InstanceId']}
+ cfnresponse.send(event, context, cfnresponse.SUCCESS, responseData, 'CustomResourcePhysicalID')
+
+ except Exception as e:
+ # logger.error(e, exc_info=True)
+ responseData = {'Error': traceback.format_exc(e)}
+ cfnresponse.send(event, context, cfnresponse.FAILED, responseData, 'CustomResourcePhysicalID')
+################## SSM BOOTSRAP HANDLER ###############
+ C9OutputBucket:
+ Type: AWS::S3::Bucket
+ DeletionPolicy: Delete
+
+ C9SSMDocument:
+ Type: AWS::SSM::Document
+ Properties:
+ Tags:
+ - Key: Environment
+ Value: AWS Example
+ Content: Yaml
+ DocumentType: Command
+ Content:
+ schemaVersion: '2.2'
+ description: Bootstrap Cloud9 Instance
+ mainSteps:
+ - action: aws:runShellScript
+ name: C9bootstrap
+ inputs:
+ runCommand:
+ - "#!/bin/bash"
+ - date
+ - . /home/ec2-user/.bashrc
+ - whoami
+ - !Sub 'echo "export KUBECTL_VERSION=${C9KubectlVersion}"'
+ - sudo -H -u ec2-user aws sts get-caller-identity
+ - echo '=== INSTALL kubectl ==='
+ - !Sub 'export KUBECTL_VERSION=${C9KubectlVersion}'
+ - sudo curl --silent --location -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl
+ - sudo chmod +x /usr/local/bin/kubectl
+ - echo '=== Install JQ and envsubst ==='
+ - sudo yum -y install jq gettext
+ - echo '=== Update to the latest AWS CLI ==='
+ - sudo -H -u ec2-user aws --version
+ - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
+ - unzip awscliv2.zip
+ - sudo ./aws/install
+ - . /home/ec2-user/.bash_profile
+ - sudo -H -u ec2-user aws --version
+ - echo '=== setup AWS configs ==='
+ - rm -vf /home/ec2-user/.aws/credentials
+ - export ACCOUNT_ID=$(aws sts get-caller-identity --output text --query Account)
+ - export AWS_REGION=$(curl -s 169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.region')
+ - echo "export ACCOUNT_ID=${ACCOUNT_ID}" >> /home/ec2-user/.bash_profile
+ - echo "export AWS_REGION=${AWS_REGION}" >> /home/ec2-user/.bash_profile
+ - sudo -H -u ec2-user aws configure set default.region ${AWS_REGION}
+ - sudo -H -u ec2-user aws configure get default.region
+ - sudo -H -u ec2-user aws sts get-caller-identity
+ - echo '=== Generate SSH key and import to aws ==='
+ - sudo -H -u ec2-user ssh-keygen -f /home/ec2-user/.ssh/id_rsa1 -P ''
+ - sudo -H -u ec2-user aws ec2 import-key-pair --key-name "eksworkshop" --public-key-material file:///home/ec2-user/.ssh/id_rsa1.pub
+ - echo '=== Install EKSCTL ==='
+ - !Sub 'export EKSCTL_VERSION=${C9EKSctlVersion}'
+ - curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/${EKSCTL_VERSION}/eksctl_Linux_amd64.tar.gz" | tar xz -C /tmp
+ - sudo mv -v /tmp/eksctl /usr/local/bin
+ - sudo -H -u ec2-user /usr/local/bin/eksctl version
+ - echo '=== Create EKS Cluster ==='
+ - !Sub 'sudo -H -u ec2-user /usr/local/bin/eksctl create cluster --version=${EKSClusterVersion} --name=${EKSClusterName} --node-private-networking --managed --nodes=2 --alb-ingress-access --region=${AWS::Region} --node-labels="lifecycle=OnDemand,intent=control-apps" --asg-access'
+ - sudo -H -u ec2-user /usr/local/bin/kubectl get nodes
+
+ C9BootstrapAssociation:
+ Type: AWS::SSM::Association
+ DependsOn:
+ - C9OutputBucket
+ Properties:
+ Name: !Ref C9SSMDocument
+ OutputLocation:
+ S3Location:
+ OutputS3BucketName: !Ref C9OutputBucket
+ OutputS3KeyPrefix: bootstrapoutput
+ Targets:
+ - Key: tag:SSMBootstrap
+ Values:
+ - Active
+
+################## INSTANCE #####################
+ C9InstanceProfile:
+ Type: AWS::IAM::InstanceProfile
+ Condition: NotEventEngine
+ Properties:
+ Path: "/"
+ Roles:
+ - Ref: C9Role
+ C9Instance:
+ Description: "-"
+ DependsOn: C9BootstrapAssociation
+ Type: AWS::Cloud9::EnvironmentEC2
+ Properties:
+ Description: AWS Cloud9 instance for Examples
+ AutomaticStopTimeMinutes: 3600
+ InstanceType:
+ Ref: C9InstanceType
+ Name:
+ Ref: AWS::StackName
+ # OwnerArn: !Sub 'arn:aws:sts::${AWS::AccountId}:assumed-role/TeamRole/MasterKey'
+ OwnerArn: !If [NotEventEngine , !Ref AWS::NoValue , !Sub 'arn:aws:sts::${AWS::AccountId}:assumed-role/TeamRole/MasterKey']
+ Tags:
+ -
+ Key: SSMBootstrap
+ Value: Active
+ -
+ Key: Environment
+ Value:
+ Ref: AWS::StackName
+
+Outputs:
+ Cloud9IDE:
+ Value:
+ Fn::Join:
+ - ''
+ - - https://
+ - Ref: AWS::Region
+ - ".console.aws.amazon.com/cloud9/ide/"
+ - Ref: C9Instance
+ - "?region="
+ - Ref: AWS::Region
+
+ EKSCluster:
+ Value:
+ Fn::Join:
+ - ''
+ - - https://
+ - Ref: AWS::Region
+ - ".console.aws.amazon.com/eks/home"
+ - "?region="
+ - Ref: AWS::Region
+ - "#/clusters/"
+ - Ref: EKSClusterName
+ EKSClusterVersion:
+ Value: !Ref EKSClusterVersion
diff --git a/content/using_ec2_spot_instances_with_eks/prerequisites/update_workspace_settings.md b/content/using_ec2_spot_instances_with_eks/prerequisites/update_workspace_settings.md
new file mode 100644
index 00000000..1c886b7e
--- /dev/null
+++ b/content/using_ec2_spot_instances_with_eks/prerequisites/update_workspace_settings.md
@@ -0,0 +1,30 @@
+---
+title: "Update Workshop Settings"
+chapter: false
+disableToc: true
+hidden: true
+---
+
+
+{{% notice info %}}
+Cloud9 normally manages IAM credentials dynamically. This isn't currently compatible with
+the EKS IAM authentication, so we will disable it and rely on the IAM role instead.
+{{% /notice %}}
+
+
+- Return to your workspace and click the sprocket, or launch a new tab to open the Preferences tab
+- Select **AWS SETTINGS**
+- Turn off **AWS managed temporary credentials**
+- Close the Preferences tab
+![c9disableiam](/images/using_ec2_spot_instances_with_eks/prerequisites/c9disableiam.png)
+
+To ensure temporary credentials aren't already in place we will also remove
+any existing credentials file:
+```
+rm -vf ${HOME}/.aws/credentials
+```
+
+
+
diff --git a/content/using_ec2_spot_instances_with_eks/prerequisites/update_workspaceiam.md b/content/using_ec2_spot_instances_with_eks/prerequisites/update_workspaceiam.md
index 46c4df5f..ac0c0834 100644
--- a/content/using_ec2_spot_instances_with_eks/prerequisites/update_workspaceiam.md
+++ b/content/using_ec2_spot_instances_with_eks/prerequisites/update_workspaceiam.md
@@ -4,23 +4,7 @@ chapter: false
weight: 60
---
-{{% notice info %}}
-Cloud9 normally manages IAM credentials dynamically. This isn't currently compatible with
-the EKS IAM authentication, so we will disable it and rely on the IAM role instead.
-{{% /notice %}}
-
-
-- Return to your workspace and click the sprocket, or launch a new tab to open the Preferences tab
-- Select **AWS SETTINGS**
-- Turn off **AWS managed temporary credentials**
-- Close the Preferences tab
-![c9disableiam](/images/using_ec2_spot_instances_with_eks/prerequisites/c9disableiam.png)
-
-To ensure temporary credentials aren't already in place we will also remove
-any existing credentials file:
-```
-rm -vf ${HOME}/.aws/credentials
-```
+{{% insert-md-from-file file="using_ec2_spot_instances_with_eks/prerequisites/update_workspace_settings.md" %}}
We should configure our aws cli with our current region as default:
```
@@ -33,21 +17,5 @@ aws configure set default.region ${AWS_REGION}
aws configure get default.region
```
-### Validate the IAM role {#validate_iam}
-
-Use the [GetCallerIdentity](https://docs.aws.amazon.com/cli/latest/reference/sts/get-caller-identity.html) CLI command to validate that the Cloud9 IDE is using the correct IAM role.
-
-```
-aws sts get-caller-identity
-
-```
-
-{{% notice note %}}
-**Select the tab** and validate the assumed role…
-{{% /notice %}}
-{{< tabs name="Region" >}}
- {{< tab name="...ON YOUR OWN" include="on_your_own_validaterole.md" />}}
- {{< tab name="...AT AN AWS EVENT" include="at_an_aws_validaterole.md" />}}
-{{< /tabs >}}
-
+{{% insert-md-from-file file="using_ec2_spot_instances_with_eks/prerequisites/validate_workspace_role.md" %}}
diff --git a/content/using_ec2_spot_instances_with_eks/prerequisites/validate_workspace_role.md b/content/using_ec2_spot_instances_with_eks/prerequisites/validate_workspace_role.md
new file mode 100644
index 00000000..01b04d65
--- /dev/null
+++ b/content/using_ec2_spot_instances_with_eks/prerequisites/validate_workspace_role.md
@@ -0,0 +1,29 @@
+---
+title: "Validate Workshpace Role"
+chapter: false
+disableToc: true
+hidden: true
+---
+
+
+### Validate the IAM role {#validate_iam}
+
+Use the [GetCallerIdentity](https://docs.aws.amazon.com/cli/latest/reference/sts/get-caller-identity.html) CLI command to validate that the Cloud9 IDE is using the correct IAM role.
+
+```
+aws sts get-caller-identity
+
+```
+
+{{% notice note %}}
+**Select the tab** and validate the assumed role…
+{{% /notice %}}
+
+{{< tabs name="Region" >}}
+ {{< tab name="...ON YOUR OWN" include="on_your_own_validaterole.md" />}}
+ {{< tab name="...AT AN AWS EVENT" include="at_an_aws_validaterole.md" />}}
+{{< /tabs >}}
+
+
diff --git a/content/using_ec2_spot_instances_with_eks/prerequisites/workspace_at_launch.md b/content/using_ec2_spot_instances_with_eks/prerequisites/workspace_at_launch.md
new file mode 100644
index 00000000..bc8505d2
--- /dev/null
+++ b/content/using_ec2_spot_instances_with_eks/prerequisites/workspace_at_launch.md
@@ -0,0 +1,18 @@
+---
+title: "Workspace at Launch"
+chapter: false
+disableToc: true
+hidden: true
+---
+
+- When it comes up, customize the environment by closing the **welcome tab**
+and **lower work area**, and opening a new **terminal** tab in the main work area:
+![c9before](/images/using_ec2_spot_instances_with_eks/prerequisites/c9before.png)
+
+- Your workspace should now look like this:
+![c9after](/images/using_ec2_spot_instances_with_eks/prerequisites/c9after.png)
+
+- If you like this theme, you can choose it yourself by selecting **View / Themes / Solarized / Solarized Dark**
+in the Cloud9 workspace menu.
diff --git a/content/using_ec2_spot_instances_with_eks/scaling/deploy_ca.files/cluster_autoscaler.yml b/content/using_ec2_spot_instances_with_eks/scaling/deploy_ca.files/cluster_autoscaler.yml
index d0dbebc5..bdc128b0 100644
--- a/content/using_ec2_spot_instances_with_eks/scaling/deploy_ca.files/cluster_autoscaler.yml
+++ b/content/using_ec2_spot_instances_with_eks/scaling/deploy_ca.files/cluster_autoscaler.yml
@@ -53,6 +53,9 @@ rules:
- apiGroups: ["batch"]
resources: ["jobs"]
verbs: ["watch","list","get"]
+- apiGroups: ["coordination.k8s.io"]
+ resources: ["leases"]
+ verbs: ["get","list","watch","create","update"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
@@ -129,7 +132,7 @@ spec:
nodeSelector:
intent: control-apps
containers:
- - image: us.gcr.io/k8s-artifacts-prod/autoscaling/cluster-autoscaler:v1.16.5
+ - image: us.gcr.io/k8s-artifacts-prod/autoscaling/cluster-autoscaler:v1.18.3
name: cluster-autoscaler
resources:
limits:
@@ -166,6 +169,4 @@ spec:
volumes:
- name: ssl-certs
hostPath:
- path: "/etc/ssl/certs/ca-bundle.crt"
-
-
+ path: "/etc/ssl/certs/ca-bundle.crt"
\ No newline at end of file
diff --git a/content/using_ec2_spot_instances_with_eks/spotworkers/deployhandler.md b/content/using_ec2_spot_instances_with_eks/spotworkers/deployhandler.md
index 63116a58..ad928a37 100644
--- a/content/using_ec2_spot_instances_with_eks/spotworkers/deployhandler.md
+++ b/content/using_ec2_spot_instances_with_eks/spotworkers/deployhandler.md
@@ -29,6 +29,7 @@ This also is our recommendation. Remember the termination handler does also hand
helm repo add eks https://aws.github.io/eks-charts
helm install aws-node-termination-handler \
--namespace kube-system \
+ --version 0.12.0 \
eks/aws-node-termination-handler
```
diff --git a/layouts/partials/custom-footer.html b/layouts/partials/custom-footer.html
index 42b02beb..8ff86d51 100644
--- a/layouts/partials/custom-footer.html
+++ b/layouts/partials/custom-footer.html
@@ -1 +1,20 @@
-{{ template "_internal/google_analytics.html" . }}
+
+
+
+
+
diff --git a/layouts/partials/menu-footer.html b/layouts/partials/menu-footer.html
index 721c12c7..04905c24 100644
--- a/layouts/partials/menu-footer.html
+++ b/layouts/partials/menu-footer.html
@@ -1,6 +1,6 @@
- Github Repo
+
EC2 Spot Workshops
@@ -9,9 +9,10 @@ EC2 Spot Workshops
Fork
- © 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
-
+
{{ partial "custom-footer.html" . }}
+
+ © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
diff --git a/layouts/shortcodes/insert-md-from-file.html b/layouts/shortcodes/insert-md-from-file.html
new file mode 100644
index 00000000..8fe5f61e
--- /dev/null
+++ b/layouts/shortcodes/insert-md-from-file.html
@@ -0,0 +1,7 @@
+
+ {{ $file := .Get "file" }}
+ {{ $page := .Site.GetPage $file }}
+ {{ with $page }}
+ {{ .Content }}
+ {{ end }}
+
diff --git a/static/css/theme-mine.css b/static/css/theme-mine.css
index 53673b5e..bb8310a1 100644
--- a/static/css/theme-mine.css
+++ b/static/css/theme-mine.css
@@ -59,14 +59,14 @@ a:hover {
padding-top: 20px !important;
}
-#sidebar #footer h2.github-title {
+#sidebar #footer h2.footer-section {
font-size: 20px;
color: #fd9827 !important;
margin: 10px 0px 5px;
padding: 0px;
font-weight: normal !important;
margin-top: 10px;
- padding-top: 30px;
+ padding-top: 5px;
border-top: 1px dotted #384657;
}
@@ -79,9 +79,10 @@ a:hover {
}
#sidebar #footer h5.copyright, #sidebar #footer p.build-number {
- font-size: 10px;
+ font-size: 15px;
letter-spacing: .15px;
line-height: 150% !important;
+ margin: 10px 0px 0px 0px
}
#body a.highlight:after {
@@ -130,6 +131,11 @@ a:hover {
#sidebar hr {
border-color: var(--MENU-SECTION-HR-color);
}
+#sidebar #prefooter hr {
+ border-color: var(--MENU-SECTION-HR-color);
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
#navigation a.nav-prev, #navigation a.nav-next {
color: #f19e39 !important;
diff --git a/static/images/using_ec2_spot_instances_with_eks/prerequisites/c9attachrole.png b/static/images/using_ec2_spot_instances_with_eks/prerequisites/c9attachrole.png
index fc26e681..ea680dac 100644
Binary files a/static/images/using_ec2_spot_instances_with_eks/prerequisites/c9attachrole.png and b/static/images/using_ec2_spot_instances_with_eks/prerequisites/c9attachrole.png differ
diff --git a/static/images/using_ec2_spot_instances_with_eks/prerequisites/c9attachroleee.png b/static/images/using_ec2_spot_instances_with_eks/prerequisites/c9attachroleee.png
index 83a9e668..00d5c2ac 100644
Binary files a/static/images/using_ec2_spot_instances_with_eks/prerequisites/c9attachroleee.png and b/static/images/using_ec2_spot_instances_with_eks/prerequisites/c9attachroleee.png differ
diff --git a/static/images/using_ec2_spot_instances_with_eks/prerequisites/c9instancerole.png b/static/images/using_ec2_spot_instances_with_eks/prerequisites/c9instancerole.png
index cde240a7..bf00acb8 100644
Binary files a/static/images/using_ec2_spot_instances_with_eks/prerequisites/c9instancerole.png and b/static/images/using_ec2_spot_instances_with_eks/prerequisites/c9instancerole.png differ
diff --git a/static/images/using_ec2_spot_instances_with_eks/prerequisites/cnf_output.png b/static/images/using_ec2_spot_instances_with_eks/prerequisites/cnf_output.png
new file mode 100644
index 00000000..5eda44b3
Binary files /dev/null and b/static/images/using_ec2_spot_instances_with_eks/prerequisites/cnf_output.png differ
diff --git a/workshops/ec2-auto-scaling-with-multiple-instance-types-and-purchase-options/spot-interruption-handler.yaml b/workshops/ec2-auto-scaling-with-multiple-instance-types-and-purchase-options/spot-interruption-handler.yaml
index 748a33c8..37dcbec8 100644
--- a/workshops/ec2-auto-scaling-with-multiple-instance-types-and-purchase-options/spot-interruption-handler.yaml
+++ b/workshops/ec2-auto-scaling-with-multiple-instance-types-and-purchase-options/spot-interruption-handler.yaml
@@ -16,6 +16,7 @@ Resources:
DependsOn:
- LambdaFunctionRole
Properties:
+ FunctionName: SpotInterruptionHandler
Handler: index.handler
Role: !GetAtt LambdaFunctionRole.Arn
Code:
@@ -85,7 +86,8 @@ Resources:
Action:
- logs:CreateLogStream
- logs:PutLogEvents
- Resource: arn:aws:logs:*:*:log-group:/aws/lambda/*SpotInterruptionHandlerFunction*:*
+ Resource:
+ - !Sub "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/SpotInterruptionHandler:*"
- Effect: Allow
Action:
- logs:CreateLogGroup