Skip to content

CLI command compatibility with v2 #450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo $BUCKET_NAME > bucket-name.txt
aws s3 mb s3://$BUCKET_NAME
aws s3 mb s3://$LAYER_BUCKET_NAME

aws iam create-role --role-name blank-csharp-role --assume-role-policy-document file://assume-policy.json
aws iam create-role --role-name blank-csharp-role --assume-role-policy-document fileb://assume-policy.json
aws iam attach-role-policy --role-name blank-csharp-role --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
aws iam attach-role-policy --role-name blank-csharp-role --policy-arn arn:aws:iam::aws:policy/AWSLambda_ReadOnlyAccess
aws iam attach-role-policy --role-name blank-csharp-role --policy-arn arn:aws:iam::aws:policy/AWSXrayWriteOnlyAccess
8 changes: 0 additions & 8 deletions sample-apps/blank-csharp-with-layer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ Use the following instructions to deploy the sample application. For more inform
- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash.
- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer.

If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`):

```
cli_binary_format=raw-in-base64-out
```

This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior.

# Setup
Download or clone this repository.

Expand Down
8 changes: 0 additions & 8 deletions sample-apps/blank-csharp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ Use the following instructions to deploy the sample application. For more inform
- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash.
- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer.

If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`):

```
cli_binary_format=raw-in-base64-out
```

This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior.

# Setup
Download or clone this repository.

Expand Down
2 changes: 1 addition & 1 deletion sample-apps/blank-go/3-invoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -eo pipefail
FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-go --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text)

while true; do
aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json
aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json
cat out.json
echo ""
sleep 2
Expand Down
8 changes: 0 additions & 8 deletions sample-apps/blank-go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ Use the following instructions to deploy the sample application.
- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash.
- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer.

If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`):

```
cli_binary_format=raw-in-base64-out
```

This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior.

# Setup
Download or clone this repository.

Expand Down
2 changes: 1 addition & 1 deletion sample-apps/blank-java/4-invoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -eo pipefail
FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-java --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text)

while true; do
aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json
aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json
cat out.json
echo ""
sleep 2
Expand Down
8 changes: 0 additions & 8 deletions sample-apps/blank-java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ Use the following instructions to deploy the sample application.
- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash.
- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer.

If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`):

```
cli_binary_format=raw-in-base64-out
```

This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior.

# Setup
Download or clone this repository.

Expand Down
8 changes: 0 additions & 8 deletions sample-apps/blank-nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ Use the following instructions to deploy the sample application. For an in-depth
- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash.
- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer.

If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`):

```
cli_binary_format=raw-in-base64-out
```

This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior.

# Setup
Download or clone this repository.

Expand Down
2 changes: 1 addition & 1 deletion sample-apps/blank-powershell/3-invoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -eo pipefail
FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-powershell --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text)

while true; do
aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json
aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json
cat out.json
echo ""
sleep 2
Expand Down
8 changes: 0 additions & 8 deletions sample-apps/blank-powershell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ Use the following instructions to deploy the sample application.
- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash.
- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer.

If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`):

```
cli_binary_format=raw-in-base64-out
```

This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior.

# Setup
Download or clone this repository.

Expand Down
2 changes: 1 addition & 1 deletion sample-apps/blank-python/4-invoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -eo pipefail
FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-python --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text)

while true; do
aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json
aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json
cat out.json
echo ""
sleep 2
Expand Down
8 changes: 0 additions & 8 deletions sample-apps/blank-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ Use the following instructions to deploy the sample application.
- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash.
- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer.

If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`):

```
cli_binary_format=raw-in-base64-out
```

This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior.

# Setup
Download or clone this repository.

Expand Down
2 changes: 1 addition & 1 deletion sample-apps/blank-ruby/4-invoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -eo pipefail
FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-ruby --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text)

while true; do
aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json
aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json
cat out.json
echo ""
sleep 2
Expand Down
8 changes: 0 additions & 8 deletions sample-apps/blank-ruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ Use the following instructions to deploy the sample application.
- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash.
- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer.

If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`):

```
cli_binary_format=raw-in-base64-out
```

This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior.

# Setup
Download or clone this repository.

Expand Down
8 changes: 0 additions & 8 deletions sample-apps/ec2-spot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ Use the following instructions to deploy the sample application. For more inform
- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash.
- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer.

If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`):

```
cli_binary_format=raw-in-base64-out
```

This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior.

# Setup
Download or clone this repository.

Expand Down
8 changes: 0 additions & 8 deletions sample-apps/efs-nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ To deploy the sample application, you need the following tools:
- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash.
- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer.

If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`):

```
cli_binary_format=raw-in-base64-out
```

This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior.

To run the sample application in AWS, you need permission to use Lambda and the following services.

- Amazon EFS ([pricing](https://aws.amazon.com/efs/pricing/))
Expand Down
4 changes: 2 additions & 2 deletions sample-apps/error-processor/4-invoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ while true; do
then
case $1 in
async)
aws lambda invoke --function-name $ERROR_FUNCTION --payload file://event.json --invocation-type Event out.json
aws lambda invoke --function-name $ERROR_FUNCTION --payload fileb://event.json --invocation-type Event out.json
;;
*)
echo -n "Unknown argument"
;;
esac
else
aws lambda invoke --function-name $ERROR_FUNCTION --payload file://event.json out.json
aws lambda invoke --function-name $ERROR_FUNCTION --payload fileb://event.json out.json
fi
cat out.json
echo ""
Expand Down
8 changes: 0 additions & 8 deletions sample-apps/error-processor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ Use the following instructions to deploy the sample application. For more inform
- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash.
- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer.

If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`):

```
cli_binary_format=raw-in-base64-out
```

This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior.

# Setup
Download or clone this repository.

Expand Down
2 changes: 1 addition & 1 deletion sample-apps/java-basic/3-invoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ while true; do
then
aws lambda invoke --function-name $FUNCTION --payload $PAYLOAD out.json
else
aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json
aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json
fi
cat out.json
echo ""
Expand Down
8 changes: 0 additions & 8 deletions sample-apps/java-basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ Use the following instructions to deploy the sample application.
- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash.
- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer.

If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`):

```
cli_binary_format=raw-in-base64-out
```

This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior.

# Setup
Download or clone this repository.

Expand Down
6 changes: 3 additions & 3 deletions sample-apps/java-events-v1sdk/4-invoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ if [ $1 ]
then
case $1 in
ddb)
PAYLOAD='file://events/dynamodb-record.json'
PAYLOAD='fileb://events/dynamodb-record.json'
;;
kin)
PAYLOAD='file://events/kinesis-record.json'
PAYLOAD='fileb://events/kinesis-record.json'
;;
*)
echo -n "Unknown event type"
Expand All @@ -20,7 +20,7 @@ while true; do
then
aws lambda invoke --function-name $FUNCTION --payload $PAYLOAD out.json
else
aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json
aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json
fi
cat out.json
echo ""
Expand Down
8 changes: 0 additions & 8 deletions sample-apps/java-events-v1sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ Use the following instructions to deploy the sample application.
- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash.
- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer.

If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`):

```
cli_binary_format=raw-in-base64-out
```

This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior.

# Setup
Download or clone this repository.

Expand Down
30 changes: 15 additions & 15 deletions sample-apps/java-events/3-invoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,46 @@ if [ $1 ]
then
case $1 in
apig)
PAYLOAD='file://events/apigateway-v1.json'
PAYLOAD='fileb://events/apigateway-v1.json'
;;
cws)
PAYLOAD='file://events/cloudwatch-scheduled.json'
PAYLOAD='fileb://events/cloudwatch-scheduled.json'
;;
cwl)
PAYLOAD='file://events/cloudwatch-logs.json'
PAYLOAD='fileb://events/cloudwatch-logs.json'
;;
sns)
PAYLOAD='file://events/sns-notification.json'
PAYLOAD='fileb://events/sns-notification.json'
;;
cdn)
PAYLOAD='file://events/cloudfront.json'
PAYLOAD='fileb://events/cloudfront.json'
;;
cfg)
PAYLOAD='file://events/config-rule.json'
PAYLOAD='fileb://events/config-rule.json'
;;
cc)
PAYLOAD='file://events/codecommit-push.json'
PAYLOAD='fileb://events/codecommit-push.json'
;;
cog)
PAYLOAD='file://events/cognito-sync.json'
PAYLOAD='fileb://events/cognito-sync.json'
;;
kin)
PAYLOAD='file://events/kinesis-record.json'
PAYLOAD='fileb://events/kinesis-record.json'
;;
fh)
PAYLOAD='file://events/firehose-record.json'
PAYLOAD='fileb://events/firehose-record.json'
;;
lex)
PAYLOAD='file://events/lex-flowers.json'
PAYLOAD='fileb://events/lex-flowers.json'
;;
ddb)
PAYLOAD='file://events/dynamodb-record.json'
PAYLOAD='fileb://events/dynamodb-record.json'
;;
s3)
PAYLOAD='file://events/s3-notification.json'
PAYLOAD='fileb://events/s3-notification.json'
;;
sqs)
PAYLOAD='file://events/sqs-record.json'
PAYLOAD='fileb://events/sqs-record.json'
;;
*)
echo -n "Unknown event type"
Expand All @@ -56,7 +56,7 @@ while true; do
then
aws lambda invoke --function-name $FUNCTION --payload $PAYLOAD out.json
else
aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json
aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json
fi
cat out.json
echo ""
Expand Down
8 changes: 0 additions & 8 deletions sample-apps/java-events/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ Use the following instructions to deploy the sample application.
- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash.
- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer.

If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`):

```
cli_binary_format=raw-in-base64-out
```

This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior.

# Setup
Download or clone this repository.

Expand Down
2 changes: 1 addition & 1 deletion sample-apps/java17-examples/3-invoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ while true; do
then
aws lambda invoke --function-name $FUNCTION --payload $PAYLOAD out.json
else
aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json
aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json
fi
cat out.json
echo ""
Expand Down
Loading