From 0cb63ea557f072c68ea5973fe9d4ac772d50f493 Mon Sep 17 00:00:00 2001 From: Amir Khairalomoum Date: Fri, 12 May 2023 15:35:48 +0100 Subject: [PATCH 01/10] fix parameters nuget icon --- .../AWS.Lambda.Powertools.Parameters.csproj | 38 ++++++++++++++++--- version.json | 2 +- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/libraries/src/AWS.Lambda.Powertools.Parameters/AWS.Lambda.Powertools.Parameters.csproj b/libraries/src/AWS.Lambda.Powertools.Parameters/AWS.Lambda.Powertools.Parameters.csproj index 66d0c52a4..0b0161f35 100644 --- a/libraries/src/AWS.Lambda.Powertools.Parameters/AWS.Lambda.Powertools.Parameters.csproj +++ b/libraries/src/AWS.Lambda.Powertools.Parameters/AWS.Lambda.Powertools.Parameters.csproj @@ -4,17 +4,45 @@ net6.0 enable enable + default + AWS.Lambda.Powertools.Parameters + 0.0.1 + Amazon Web Services + Amazon.com, Inc + AWS Lambda Powertools for .NET + AWS Lambda Powertools for .NET - Parameters package. + Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + https://github.com/awslabs/aws-lambda-powertools-dotnet + Apache-2.0 + AWS;Amazon;Lambda;Powertools + README.md + https://sdk-for-net.amazonwebservices.com/images/AWSLogo128x128.png + AWSLogo128x128.png + true + AWS.Lambda.Powertools.Parameters + AWS.Lambda.Powertools.Parameters + + true + + + + + + - - - - + - + + + + + + + diff --git a/version.json b/version.json index a9c8d7c46..804b99f80 100644 --- a/version.json +++ b/version.json @@ -6,6 +6,6 @@ "Tracing": "1.1.0" }, "Utilities": { - "Parameters": "0.0.1-preview" + "Parameters": "0.0.2-preview" } } From 7c6df53120557165ff9026ae1b5cccce19b30f6d Mon Sep 17 00:00:00 2001 From: Amir Khairalomoum Date: Mon, 15 May 2023 10:11:05 +0100 Subject: [PATCH 02/10] remove the version change --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 804b99f80..a9c8d7c46 100644 --- a/version.json +++ b/version.json @@ -6,6 +6,6 @@ "Tracing": "1.1.0" }, "Utilities": { - "Parameters": "0.0.2-preview" + "Parameters": "0.0.1-preview" } } From 1888e80bb614b775e045a7acd12e78dd1af5f315 Mon Sep 17 00:00:00 2001 From: Leandro Damascena Date: Mon, 15 May 2023 12:04:50 +0100 Subject: [PATCH 03/10] docs: adding permission --- docs/utilities/parameters.md | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/docs/utilities/parameters.md b/docs/utilities/parameters.md index d138af0d0..44aecb64b 100644 --- a/docs/utilities/parameters.md +++ b/docs/utilities/parameters.md @@ -28,13 +28,14 @@ Powertools are available as NuGet packages. You can install the packages from [N This utility requires additional permissions to work as expected. See the table below: -Provider | Function/Method | IAM Permission -------------------------------------------------- | ------------------------------------------------- | --------------------------------------------------------------------------------- -SSM Parameter Store | `SsmProvider.Get(string)` `SsmProvider.Get(string)` | `ssm:GetParameter` -SSM Parameter Store | `SsmProvider.GetMultiple(string)` `SsmProvider.GetMultiple(string)` | `ssm:GetParametersByPath` -Secrets Manager | `SecretsProvider.Get(string)` `SecretsProvider.Get(string)` | `secretsmanager:GetSecretValue` -DynamoDB | `DynamoDBProvider.Get(string)` `DynamoDBProvider.Get(string)` | `dynamodb:GetItem` -DynamoDB | `DynamoDBProvider.GetMultiple(string)` `DynamoDBProvider.GetMultiple(string)` | `dynamodb:Query` +| Provider | Function/Method | IAM Permission | +| ------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------- | +| SSM Parameter Store | `SsmProvider.Get(string)` `SsmProvider.Get(string)` | `ssm:GetParameter` | +| SSM Parameter Store | `SsmProvider.GetMultiple(string)` `SsmProvider.GetMultiple(string)` | `ssm:GetParametersByPath` | +| SSM Parameter Store | If using **`WithDecryption()`** option | You must add an additional permission `kms:Decrypt` | +| Secrets Manager | `SecretsProvider.Get(string)` `SecretsProvider.Get(string)` | `secretsmanager:GetSecretValue` | +| DynamoDB | `DynamoDBProvider.Get(string)` `DynamoDBProvider.Get(string)` | `dynamodb:GetItem` | +| DynamoDB | `DynamoDBProvider.GetMultiple(string)` `DynamoDBProvider.GetMultiple(string)` | `dynamodb:Query` | ## SSM Parameter Store @@ -138,10 +139,12 @@ in order to get data from other regions or use specific credentials. The AWS Systems Manager Parameter Store provider supports two additional arguments for the `Get()` and `GetMultiple()` methods: -| Option | Default | Description | -|---------------|---------|-------------| -| **WithDecryption()** | `False` | Will automatically decrypt the parameter. | -| **Recursive()** | `False` | For `GetMultiple()` only, will fetch all parameter values recursively based on a path prefix. | +| Option | Default | Description | +| -------------------- | ------- | --------------------------------------------------------------------------------------------- | +| **WithDecryption()** | `False` | Will automatically decrypt the parameter. | +| **Recursive()** | `False` | For `GetMultiple()` only, will fetch all parameter values recursively based on a path prefix. | + +You can create `SecureString` parameters, which are parameters that have a plaintext parameter name and an encrypted parameter value. If you don't use the `WithDecryption()` option, you will get an encrypted value. Read [here](https://docs.aws.amazon.com/kms/latest/developerguide/services-parameter-store.html) about best practices using KMS to secure your parameters. **Example:** @@ -350,8 +353,8 @@ DynamoDB provider can be customized at initialization to match your table struct | -------------- | --------- | ------- | ---------------------------------------------------------------------------------------------------------- | | **table_name** | **Yes** | *(N/A)* | Name of the DynamoDB table containing the parameter values. | | **key_attr** | No | `id` | Hash key for the DynamoDB table. | -| **sort_attr** | No | `sk` | Range key for the DynamoDB table. You don't need to set this if you don't use the `GetMultiple()` method. | -| **value_attr** | No | `value` | Name of the attribute containing the parameter value. +| **sort_attr** | No | `sk` | Range key for the DynamoDB table. You don't need to set this if you don't use the `GetMultiple()` method. | +| **value_attr** | No | `value` | Name of the attribute containing the parameter value. | === "DynamoDBProvider" From cccc5485b3181137eea177b2207463c86e2b4b89 Mon Sep 17 00:00:00 2001 From: Henrique Graca <999396+hjgraca@users.noreply.github.com> Date: Tue, 16 May 2023 15:41:15 +0200 Subject: [PATCH 04/10] Update mkdocs.yml add restrict_base_path: false --- mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/mkdocs.yml b/mkdocs.yml index 0ecd77ba5..f96608374 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -63,6 +63,7 @@ markdown_extensions: - pymdownx.snippets: base_path: "." check_paths: true + restrict_base_path: false - meta - toc: permalink: true From b588b2156fa3b98a7b9d96718b76e068b24406db Mon Sep 17 00:00:00 2001 From: Simon Thulbourn Date: Wed, 17 May 2023 12:45:36 +0200 Subject: [PATCH 05/10] feat(docs): Start S3 Docs --- .github/workflows/docs.yml | 27 +++++++++++++++++++++ .github/workflows/on_push_docs.yml | 1 + .github/workflows/reusable_publish_docs.yml | 26 +++++++++++++++++++- 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b95a2ea6e..8b8f3057d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,6 +5,11 @@ on: branches: - main +permissions: + id-token: write + contents: write + pages: write + jobs: docs: # Force Github action to run only a single job at a time (based on the group name) @@ -12,6 +17,7 @@ jobs: concurrency: group: on-docs-build runs-on: ubuntu-latest + environment: Docs steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c with: @@ -32,12 +38,23 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./dist + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef + with: + aws-region: us-east-1 + role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }} + - name: Deploy Docs + run: | + aws s3 sync \ + dist \ + s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-dotnet/ apidocs: # Force Github action to run only a single job at a time (based on the group name) # This is to prevent "race-condition" in publishing a new version of doc to `gh-pages` concurrency: group: on-docs-build runs-on: ubuntu-latest + environment: Docs steps: - uses: actions/checkout@v3 - name: Setup .NET 6.0 @@ -58,3 +75,13 @@ jobs: publish_dir: ./apidocs/_site keep_files: true destination_dir: api + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef + with: + aws-region: us-east-1 + role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }} + - name: Deploy Docs + run: | + aws s3 sync \ + apidocs/_site \ + s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-dotnet/api/ diff --git a/.github/workflows/on_push_docs.yml b/.github/workflows/on_push_docs.yml index d46879ca6..dc0642158 100644 --- a/.github/workflows/on_push_docs.yml +++ b/.github/workflows/on_push_docs.yml @@ -20,6 +20,7 @@ jobs: permissions: contents: write pages: write + id-token: write uses: ./.github/workflows/reusable_publish_docs.yml with: version: develop diff --git a/.github/workflows/reusable_publish_docs.yml b/.github/workflows/reusable_publish_docs.yml index 822ce867d..d2744eaff 100644 --- a/.github/workflows/reusable_publish_docs.yml +++ b/.github/workflows/reusable_publish_docs.yml @@ -22,6 +22,7 @@ on: type: boolean permissions: + id-token: write contents: write pages: write @@ -32,6 +33,7 @@ jobs: concurrency: group: on-docs-rebuild runs-on: ubuntu-latest + environment: Docs steps: - uses: actions/checkout@v3 with: @@ -82,6 +84,17 @@ jobs: keep_files: true destination_dir: latest/api + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef + with: + aws-region: us-east-1 + role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }} + - name: Deploy Docs + run: | + aws s3 sync \ + dist \ + s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-dotnet/ + apidocs: # Force Github action to run only a single job at a time (based on the group name) @@ -89,6 +102,7 @@ jobs: concurrency: group: on-docs-build runs-on: macos-latest + environment: Docs steps: - uses: actions/checkout@v3 with: @@ -103,4 +117,14 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./apidocs/_site keep_files: true - destination_dir: api \ No newline at end of file + destination_dir: api + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef + with: + aws-region: us-east-1 + role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }} + - name: Deploy Docs + run: | + aws s3 sync \ + apidocs/_site \ + s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-dotnet/api/ \ No newline at end of file From 4c1c14f268c5672a00b78a721e00c7aaebb53730 Mon Sep 17 00:00:00 2001 From: Henrique Graca <999396+hjgraca@users.noreply.github.com> Date: Wed, 17 May 2023 13:33:37 +0200 Subject: [PATCH 06/10] update api docs generation --- .github/workflows/docs.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8b8f3057d..6d576ec9b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -61,19 +61,15 @@ jobs: uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a with: dotnet-version: 6.0.405 - - name: Install solution dependencies - run: | - dotnet new tool-manifest - dotnet tool install docfx - - name: Create API docs - run: | - dotnet docfx apidocs/docfx.json + - uses: nikeee/docfx-action@b9c2cf92e3b4aa06878a1410833a8828b4bdcd26 #1.0.0 + name: Build Documentation + with: + args: apidocs/docfx.json - name: Release API docs to latest uses: peaceiris/actions-gh-pages@bd8c6b06eba6b3d25d72b7a1767993c0aeee42e7 # v3.9.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./apidocs/_site - keep_files: true destination_dir: api - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef From 1f661cbebcf0c52818fca9c29c0eeec4b9b5bfb2 Mon Sep 17 00:00:00 2001 From: Henrique Graca <999396+hjgraca@users.noreply.github.com> Date: Wed, 17 May 2023 13:33:59 +0200 Subject: [PATCH 07/10] Delete on_push_docs.yml --- .github/workflows/on_push_docs.yml | 36 ------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 .github/workflows/on_push_docs.yml diff --git a/.github/workflows/on_push_docs.yml b/.github/workflows/on_push_docs.yml deleted file mode 100644 index dc0642158..000000000 --- a/.github/workflows/on_push_docs.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Docs - -on: - push: - branches: - - develop - paths: - - "docs/**" - - "mkdocs.yml" - - "examples/**" - -jobs: - changelog: - permissions: - contents: write - uses: ./.github/workflows/reusable_publish_changelog.yml - - release-docs: - needs: changelog - permissions: - contents: write - pages: write - id-token: write - uses: ./.github/workflows/reusable_publish_docs.yml - with: - version: develop - alias: stage -# Maintenance: Only necessary in repo migration -# - name: Create redirect from old docs -# run: | -# git checkout gh-pages -# test -f 404.html && echo "Redirect already set" && exit 0 -# git checkout develop -- 404.html -# git add 404.html -# git commit -m "chore: set docs redirect" --no-verify -# git push origin gh-pages -f From f7380ed9b7febe248180430bf658d43255b4bd53 Mon Sep 17 00:00:00 2001 From: Henrique Graca <999396+hjgraca@users.noreply.github.com> Date: Wed, 17 May 2023 13:34:40 +0200 Subject: [PATCH 08/10] Update docfx.json --- apidocs/docfx.json | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/apidocs/docfx.json b/apidocs/docfx.json index d3be77747..490abbcc2 100644 --- a/apidocs/docfx.json +++ b/apidocs/docfx.json @@ -3,11 +3,8 @@ { "src": [ { - "files": [ - "**/*.csproj" - ], - "src": "../libraries/src/", - "force": true + "files": ["**/*.csproj"], + "src": "../libraries/src/" } ], "dest": "api", @@ -21,23 +18,16 @@ "build": { "content": [ { - "files": ["api/**.yml", "api/index.md"] + "files": ["api/**"] }, { - "files": ["toc.yml", "*.md"] + "files": ["toc.yml", "*.md"], + "exclude": ["_site/**", "**/bin/**", "**/obj/**", "**/[Tt]ests/**"] } ], "resource": [ { - "files": [ - "images/**" - ] - } - ], - "overwrite": [ - { - "files": ["apidoc/**.md"], - "exclude": ["obj/**", "_site/**"] + "files": ["images/**"] } ], "dest": "_site", @@ -60,4 +50,4 @@ "cleanupCacheHistory": false, "disableGitFeatures": false } -} \ No newline at end of file +} From af6f18170b5bbdd3ed032f6d8e80266f172c9243 Mon Sep 17 00:00:00 2001 From: Simon Thulbourn Date: Wed, 17 May 2023 13:44:35 +0200 Subject: [PATCH 09/10] Update docs.yml --- .github/workflows/docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6d576ec9b..8fd78ec5a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,6 +4,7 @@ on: push: branches: - main + workflow_dispatch: {} permissions: id-token: write From 049c3591fea360b59844585ed3acdbc843ff086c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 May 2023 14:22:41 +0000 Subject: [PATCH 10/10] Bump pymdown-extensions from 9.9 to 10.0 Bumps [pymdown-extensions](https://github.com/facelessuser/pymdown-extensions) from 9.9 to 10.0. - [Release notes](https://github.com/facelessuser/pymdown-extensions/releases) - [Commits](https://github.com/facelessuser/pymdown-extensions/compare/9.9...10.0) --- updated-dependencies: - dependency-name: pymdown-extensions dependency-type: indirect ... Signed-off-by: dependabot[bot] --- poetry.lock | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/poetry.lock b/poetry.lock index 7c0c05aea..66ac82b91 100644 --- a/poetry.lock +++ b/poetry.lock @@ -321,18 +321,19 @@ plugins = ["importlib-metadata"] [[package]] name = "pymdown-extensions" -version = "9.9" +version = "10.0" description = "Extension pack for Python Markdown." category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "pymdown_extensions-9.9-py3-none-any.whl", hash = "sha256:ac698c15265680db5eb13cd4342abfcde2079ac01e5486028f47a1b41547b859"}, - {file = "pymdown_extensions-9.9.tar.gz", hash = "sha256:0f8fb7b74a37a61cc34e90b2c91865458b713ec774894ffad64353a5fce85cfc"}, + {file = "pymdown_extensions-10.0-py3-none-any.whl", hash = "sha256:e6cbe8ace7d8feda30bc4fd6a21a073893a9a0e90c373e92d69ce5b653051f55"}, + {file = "pymdown_extensions-10.0.tar.gz", hash = "sha256:9a77955e63528c2ee98073a1fb3207c1a45607bc74a34ef21acd098f46c3aa8a"}, ] [package.dependencies] markdown = ">=3.2" +pyyaml = "*" [[package]] name = "python-dateutil"