Skip to content

Commit

Permalink
Fix syntax highlighting for all code examples in guides
Browse files Browse the repository at this point in the history
Fixes #12733
  • Loading branch information
knutwannheden committed Oct 15, 2020
1 parent 2377c39 commit 09b4982
Show file tree
Hide file tree
Showing 98 changed files with 740 additions and 685 deletions.
6 changes: 3 additions & 3 deletions docs/src/main/asciidoc/amazon-dynamodb.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ To complete this guide, you need:

The easiest way to start working with DynamoDB is to run a local instance as a container.

[source,shell,subs="verbatim,attributes"]
[source,bash,subs="verbatim,attributes"]
----
docker run --publish 8000:8000 amazon/dynamodb-local:1.11.477 -jar DynamoDBLocal.jar -inMemory -sharedDb
----
Expand Down Expand Up @@ -76,7 +76,7 @@ For more information, see https://docs.aws.amazon.com/amazondynamodb/latest/deve

We recommend to use the AWS CLI to provision the table:

[source,shell,subs="verbatim,attributes"]
[source,bash,subs="verbatim,attributes"]
----
aws dynamodb create-table --table-name QuarkusFruits \
--attribute-definitions AttributeName=fruitName,AttributeType=S \
Expand All @@ -98,7 +98,7 @@ The solution is located in the `amazon-dynamodb-quickstart` {quickstarts-tree-ur

First, we need a new project. Create a new project with the following command:

[source,shell,subs=attributes+]
[source,bash,subs=attributes+]
----
mvn io.quarkus:quarkus-maven-plugin:{quarkus-version}:create \
-DprojectGroupId=org.acme \
Expand Down
12 changes: 6 additions & 6 deletions docs/src/main/asciidoc/amazon-kms.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ To complete this guide, you need:

The easiest way to start working with KMS is to run a local instance as a container.

[source,shell,subs="verbatim,attributes"]
[source,bash,subs="verbatim,attributes"]
----
docker run --rm --name local-kms --publish 8011:4599 -e SERVICES=kms -e START_WEB=0 -d localstack/localstack:0.11.1
----
This starts a KMS instance that is accessible on port `8011`.

Create an AWS profile for your local instance using AWS CLI:
[source,shell,subs="verbatim,attributes"]
[source,bash,subs="verbatim,attributes"]
----
$ aws configure --profile localstack
AWS Access Key ID [None]: test-key
Expand All @@ -59,18 +59,18 @@ Default output format [None]:

Create a KMS master key queue using AWS CLI and store in `MASTER_KEY_ARN` environment variable.

[source,shell,subs="verbatim,attributes"]
[source,bash,subs="verbatim,attributes"]
----
MASTER_KEY_ARN=`aws kms create-key --profile localstack --endpoint-url=http://localhost:8011 | cut -f3`
----
Generate a key data as 256-bit symmetric key (AES 256)
[source,shell,subs="verbatim,attributes"]
[source,bash,subs="verbatim,attributes"]
----
aws kms generate-data-key --key-id $MASTER_KEY_ARN --key-spec AES_256 --profile localstack --endpoint-url=http://localhost:8011
----

Or, if you want to use your AWS account create a key using your default profile
[source,shell,subs="verbatim,attributes"]
[source,bash,subs="verbatim,attributes"]
----
MASTER_KEY_ARN=`aws kms create-key | cut -f3`
aws kms generate-data-key --key-id $MASTER_KEY_ARN --key-spec AES_256
Expand All @@ -90,7 +90,7 @@ The solution is located in the `amazon-kms-quickstart` {quickstarts-tree-url}/am

First, we need a new project. Create a new project with the following command:

[source,shell,subs=attributes+]
[source,bash,subs=attributes+]
----
mvn io.quarkus:quarkus-maven-plugin:{quarkus-version}:create \
-DprojectGroupId=org.acme \
Expand Down
24 changes: 12 additions & 12 deletions docs/src/main/asciidoc/amazon-lambda-http.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ for installing AWS SAM CLI.
Create the Quarkus AWS Lambda maven project using our Maven Archetype.


[source, subs=attributes+]
[source,bash,subs=attributes+]
----
mvn archetype:generate \
-DarchetypeGroupId=io.quarkus \
Expand All @@ -54,7 +54,7 @@ mvn archetype:generate \

Build the project using maven.

[source, subs=attributes+]
[source,bash,subs=attributes+]
----
./mvnw clean install
----
Expand All @@ -66,7 +66,7 @@ available with this extension.
If you want to build for native too, make sure you have GraalVM installed correctly and just add a `native` property
to the build

[source, subs=attributes+]
[source,bash,subs=attributes+]
----
./mvnw clean install -Dnative
----
Expand All @@ -75,7 +75,7 @@ NOTE: If you are building on a non-Linux system, you will need to also pass in a
Lambda requires linux binaries. You can do this by passing this property to your Maven build:
`-Dnative-image.docker-build=true`, or for Gradle: `--docker-build=true`. This requires you to have docker installed locally, however.

[source, subs=attributes+]
[source,bash,subs=attributes+]
----
./mvnw clean install -Dnative -Dnative-image.docker-build=true
----
Expand All @@ -94,7 +94,7 @@ are in the the build directory: `target/` for maven, `build/` for gradle.
The AWS SAM CLI allows you to run your lambda's locally on your laptop in a simulated Lambda environment. This requires docker to be installed (see their install docs).
After you have built your maven project, execute this command

[source, subs=attributes+]
[source,bash,subs=attributes+]
----
sam local start-api --template target/sam.jvm.yaml
----
Expand All @@ -110,7 +110,7 @@ lambda as pure Java.
If you want to deploy a native executable of your lambda, use a different yaml template that is provided in your
generated project:

[source, subs=attributes+]
[source,bash,subs=attributes+]
----
sam local start-api --template target/sam.native.yaml
----
Expand All @@ -121,7 +121,7 @@ There are a few steps to get your lambda running on AWS.

=== Package your deployment.

[source, subs=attributes+]
[source,bash,subs=attributes+]
----
sam package --template-file target/sam.jvm.yaml --output-template-file packaged.yaml --s3-bucket <YOUR_S3_BUCKET>
----
Expand All @@ -131,7 +131,7 @@ Type the simple name of your S3 bucket you created during. If you've built a na

=== Deploy your package

[source, subs=attributes+]
[source,bash,subs=attributes+]
----
sam deploy --template-file packaged.yaml --capabilities CAPABILITY_IAM --stack-name <YOUR_STACK_NAME>
----
Expand All @@ -143,7 +143,7 @@ The stack name can be anything you want.
If `sam deploy`, run the `describe-stack-events` command
to get information about your deployment and what happened.

[source, subs=attributes+]
[source,bash,subs=attributes+]
----
aws cloudformation describe-stack-events --stack-name <YOUR_STACK_NAME>
----
Expand All @@ -165,7 +165,7 @@ To fix this error you'll need to create an S3 bucket in that region and redo ste
Another annoying this is that if there is an error in deployment, you also have to completely delete
it before trying to deploy again:

[source, subs=attributes+]
[source,bash,subs=attributes+]
----
aws cloudformation delete-stack --stack-name <YOUR_STACK_NAME>
----
Expand All @@ -174,13 +174,13 @@ aws cloudformation delete-stack --stack-name <YOUR_STACK_NAME>

To get the root URL for your service, type the following command and see the following output:

[source, subs=attributes+]
[source,bash,subs=attributes+]
----
aws cloudformation describe-stacks --stack-name <YOUR_STACK_NAME>
----

It should give you something like the following output:
[source, subs=attributes+]
[source,subs=attributes+]
----
{
"Stacks": [
Expand Down
Loading

0 comments on commit 09b4982

Please sign in to comment.