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
| aws cloudformation create-stack --stack-name gh-actions-user \ | |
| --template-body file://main.yml \ | |
| --parameters ParameterKey=AssetsBucket,ParameterValue=my-assets-bucket \ | |
| ParameterKey=ExternalId,ParameterValue=ExternalID \ | |
| ParameterKey=ProjectName,ParameterValue=MyProject \ | |
| --tags Key=project,Value=MyProject \ | |
| --region ap-southeast-2 \ | |
| --capabilities CAPABILITY_NAMED_IAM \ | |
| --output yaml \ | |
| --profile my-profile |
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
| [gh-actions-user] | |
| aws_access_key_id=ABC123 | |
| aws_secret_access_key=abc123 |
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
| aws sts assume-role \ | |
| --role-arn arn:aws:iam::{Your AWS Account}:role/role-name \ | |
| --role-session-name TestSession \ | |
| --external-id ExternalID \ | |
| --profile gh-actions-user |
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
| { | |
| "Credentials": { | |
| "AccessKeyId": "ABC123", | |
| "SecretAccessKey": "abc123", | |
| "SessionToken": "XYZ==", | |
| "Expiration": "2021-01-01T23:23:23+00:00" | |
| }, | |
| "AssumedRoleUser": { | |
| "AssumedRoleId": "ABC:TestSession", | |
| "Arn": "arn:aws:sts::{Your AWS Account}:assumed-role/role-name/TestSession" |
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
| AWS_ACCESS_KEY_ID=ABC123 \ | |
| AWS_SECRET_ACCESS_KEY=abc123 \ | |
| AWS_SESSION_TOKEN=XYZ== \ | |
| aws s3 ls s3://my-assets-bucket |
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
| name: Upload assets to S3 bucket | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| upload: | |
| name: Upload assets to S3 bucket |
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' | |
| Resources: | |
| InvoicesTable: | |
| Type: AWS::DynamoDB::Table | |
| Properties: | |
| AttributeDefinitions: | |
| - AttributeName: pk | |
| AttributeType: S | |
| - AttributeName: sk |
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
| // Invoice describes dynamodb representation of invoice header | |
| type Invoice struct { | |
| PK string `dynamodbav:"pk"` | |
| SK string `dynamodbav:"sk"` | |
| ID string `dynamodbav:"id"` | |
| Number string `dynamodbav:"number"` | |
| CustomerName string `dynamodbav:"customerName"` | |
| Status string `dynamodbav:"status"` | |
| Date string `dynamodbav:"date"` | |
| CreatedAt time.Time `dynamodbav:"createdAt"` |
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
| input := &dynamodb.QueryInput{ | |
| ExpressionAttributeValues: map[string]*dynamodb.AttributeValue{ | |
| ":v1": { | |
| S: aws.String("No One You Know"), | |
| }, | |
| }, | |
| KeyConditionExpression: aws.String("Artist = :v1"), | |
| ProjectionExpression: aws.String("SongTitle"), | |
| TableName: aws.String("Music"), | |
| } |
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
| keyCond := expression.Key("Artist").Equal(expression.Value("No One You Know")) | |
| proj := expression.NamesList(expression.Name("SongTitle")) | |
| expr, err := expression.NewBuilder(). | |
| WithKeyCondition(keyCond). | |
| WithProjection(proj). | |
| Build() | |
| if err != nil { | |
| fmt.Println(err) |