This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UserData: | |
| Fn::Base64: | |
| Fn::Sub: | |
| - | | |
| #!/bin/bash -xe | |
| echo ECS_CLUSTER=${EcsCluster} >> /etc/ecs/ecs.config | |
| yum install -y aws-cfn-bootstrap ec2-instance-connect awscli | |
| amazon-linux-extras install epel | |
| yum install -y s3fs-fuse | |
| mkdir -p /srv/omaha_s3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Display Linux system information | |
| :> uname -a | |
| # Display kernel release information | |
| :> uname -r | |
| # Show which version of Ubuntu installed (Similar command is available to other distros) | |
| :> cat /etc/lsb_release | |
| :> lsb_release -a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fetchServerInformation = async (url: URL): Promise<[finalURL: URL, version: string]> => { | |
| // ... | |
| const endpoint = new URL('api/info', url); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: '2010-09-09' | |
| Transform: AWS::Serverless-2016-10-31 | |
| Description: Lambda to send notification for ElastiCache Events | |
| Parameters: | |
| EnvironmentName: | |
| Type: String | |
| EnvironmentType: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Resources: | |
| LambdaFunction: | |
| Type: AWS::Serverless::Function | |
| Properties: | |
| CodeUri: src/ | |
| Handler: main | |
| Runtime: go1.x | |
| Environment: | |
| Variables: | |
| WEBHOOK_URL: !Ref WebhookUrl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Topic: | |
| Type: AWS::SNS::Topic | |
| Properties: | |
| TopicName: !Sub ${AWS::StackName} | |
| DisplayName: A topic that receives ElastiCache Events and triggers lambda to send notification. | |
| Subscription: | |
| - Endpoint: !GetAtt LambdaFunction.Arn | |
| Protocol: lambda | |
| Tags: | |
| - Key: EnvironmentName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LambdaPermission: | |
| Type: AWS::Lambda::Permission | |
| Properties: | |
| Action: 'lambda:InvokeFunction' | |
| FunctionName: !Ref LambdaFunction | |
| Principal: sns.amazonaws.com | |
| SourceArn: !Ref Topic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Outputs: | |
| TopicArn: | |
| Value: !Ref Topic | |
| Export: | |
| Name: !Sub "${EnvironmentName}:ElastiCache:Events:TopicArn" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "github.com/aws/aws-lambda-go/lambda" | |
| "github.com/aws/aws-lambda-go/events" | |
| ) | |
| func handler(snsEvent events.SNSEvent) (error) { | |
| return nil | |
| } |
OlderNewer