From a409bc1f96fda125ee867c9229aeb1d6ed0056ae Mon Sep 17 00:00:00 2001 From: Eileen Yu <48944635+Eileen-Yu@users.noreply.github.com> Date: Thu, 25 Jul 2024 09:40:08 -0700 Subject: [PATCH] fix: drop duplicate awsRegion/region field (#3490) Signed-off-by: Eileen Yu --- .../builtin-authentication-profiles.yaml | 2 +- bindings/aws/s3/metadata.yaml | 8 +------- bindings/aws/s3/s3.go | 2 +- bindings/postgres/metadata.yaml | 2 +- configuration/postgres/metadata.yaml | 2 +- pubsub/aws/snssqs/metadata.go | 2 +- pubsub/aws/snssqs/metadata.yaml | 12 +----------- secretstores/aws/parameterstore/metadata.yaml | 16 +--------------- .../aws/parameterstore/parameterstore.go | 8 +++++--- state/aws/dynamodb/dynamodb.go | 2 +- state/aws/dynamodb/metadata.yaml | 12 +----------- 11 files changed, 15 insertions(+), 53 deletions(-) diff --git a/.build-tools/builtin-authentication-profiles.yaml b/.build-tools/builtin-authentication-profiles.yaml index 5c8557471e..9113cf286b 100644 --- a/.build-tools/builtin-authentication-profiles.yaml +++ b/.build-tools/builtin-authentication-profiles.yaml @@ -7,7 +7,7 @@ aws: type: string required: true description: | - The AWS Region where the AWS Relational Database Service is deployed to. + The AWS Region where the AWS resource is deployed to. example: '"us-east-1"' - name: accessKey description: AWS access key associated with an IAM account diff --git a/bindings/aws/s3/metadata.yaml b/bindings/aws/s3/metadata.yaml index dd573c5466..e33fcbad3c 100644 --- a/bindings/aws/s3/metadata.yaml +++ b/bindings/aws/s3/metadata.yaml @@ -29,12 +29,6 @@ metadata: The name of the S3 bucket to write to. example: '"bucket"' type: string - - name: region - required: true - description: | - The specific AWS region where the S3 bucket is located. - example: '"us-east-1"' - type: string - name: endpoint required: false description: | @@ -75,4 +69,4 @@ metadata: When connecting to `https://` endpoints, accepts self-signed or invalid certificates. type: bool default: 'false' - example: '"true", "false"' \ No newline at end of file + example: '"true", "false"' diff --git a/bindings/aws/s3/s3.go b/bindings/aws/s3/s3.go index 545dd0cf3d..70a0c8a518 100644 --- a/bindings/aws/s3/s3.go +++ b/bindings/aws/s3/s3.go @@ -74,7 +74,7 @@ type s3Metadata struct { SecretKey string `json:"secretKey" mapstructure:"secretKey" mdignore:"true"` SessionToken string `json:"sessionToken" mapstructure:"sessionToken" mdignore:"true"` - Region string `json:"region" mapstructure:"region"` + Region string `json:"region" mapstructure:"region" mapstructurealiases:"awsRegion" mdignore:"true"` Endpoint string `json:"endpoint" mapstructure:"endpoint"` Bucket string `json:"bucket" mapstructure:"bucket"` DecodeBase64 bool `json:"decodeBase64,string" mapstructure:"decodeBase64"` diff --git a/bindings/postgres/metadata.yaml b/bindings/postgres/metadata.yaml index 7ec2afc023..6a9908a038 100644 --- a/bindings/postgres/metadata.yaml +++ b/bindings/postgres/metadata.yaml @@ -125,4 +125,4 @@ metadata: - "exec" - "simple_protocol" example: "cache_describe" - default: "" \ No newline at end of file + default: "" diff --git a/configuration/postgres/metadata.yaml b/configuration/postgres/metadata.yaml index 27ca4e3c00..401d704e30 100644 --- a/configuration/postgres/metadata.yaml +++ b/configuration/postgres/metadata.yaml @@ -123,4 +123,4 @@ metadata: - "exec" - "simple_protocol" example: "cache_describe" - default: "" \ No newline at end of file + default: "" diff --git a/pubsub/aws/snssqs/metadata.go b/pubsub/aws/snssqs/metadata.go index b839f40936..113cf126b2 100644 --- a/pubsub/aws/snssqs/metadata.go +++ b/pubsub/aws/snssqs/metadata.go @@ -22,7 +22,7 @@ type snsSqsMetadata struct { // aws endpoint for the component to use. Endpoint string `mapstructure:"endpoint"` // aws region in which SNS/SQS should create resources. - Region string `mapstructure:"region"` + Region string `json:"region" mapstructure:"region" mapstructurealiases:"awsRegion" mdignore:"true"` // aws partition in which SNS/SQS should create resources. internalPartition string `mapstructure:"-"` // name of the queue for this application. The is provided by the runtime as "consumerID". diff --git a/pubsub/aws/snssqs/metadata.yaml b/pubsub/aws/snssqs/metadata.yaml index ffdf2397a1..641ab4ea07 100644 --- a/pubsub/aws/snssqs/metadata.yaml +++ b/pubsub/aws/snssqs/metadata.yaml @@ -13,16 +13,6 @@ capabilities: builtinAuthenticationProfiles: - name: "aws" metadata: - - name: region - required: true - description: | - The AWS region where the SNS/SQS assets are located or be created in. See the `Supported AWS services per region` page. - Ensure that SNS and SQS are available in that region. - url: - title: "Supported AWS services per region" - url: "https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/?p=ugi&l=na" - example: '"us-east-1"' - type: string - name: endpoint required: false description: | @@ -143,4 +133,4 @@ metadata: description: | The AWS account ID. Resolved automatically if not provided. example: '""' - type: string \ No newline at end of file + type: string diff --git a/secretstores/aws/parameterstore/metadata.yaml b/secretstores/aws/parameterstore/metadata.yaml index e8b40d6441..0577bd00d9 100644 --- a/secretstores/aws/parameterstore/metadata.yaml +++ b/secretstores/aws/parameterstore/metadata.yaml @@ -11,24 +11,10 @@ urls: builtinAuthenticationProfiles: - name: "aws" metadata: - - name: region - required: true - description: | - The specific AWS region the AWS SSM Parameter Store instance is deployed in. - example: '"us-east-1"' - type: string - - name: sessionToken - required: false - sensitive: true - description: | - AWS session token to use. A session token is only required if you are using - temporary security credentials. - example: '"TOKEN"' - type: string - name: prefix required: false description: | The SSM Parameter Store prefix to be specified. If specified, it will be used as the 'BeginsWith' as part of the 'ParameterStringFilter'. example: '"myprefix"' - type: string \ No newline at end of file + type: string diff --git a/secretstores/aws/parameterstore/parameterstore.go b/secretstores/aws/parameterstore/parameterstore.go index 6581208c96..38c22fc5ad 100644 --- a/secretstores/aws/parameterstore/parameterstore.go +++ b/secretstores/aws/parameterstore/parameterstore.go @@ -45,11 +45,13 @@ func NewParameterStore(logger logger.Logger) secretstores.SecretStore { } type ParameterStoreMetaData struct { - Region string `json:"region"` + // Ignored by metadata parser because included in built-in authentication profile AccessKey string `json:"accessKey" mapstructure:"accessKey" mdignore:"true"` SecretKey string `json:"secretKey" mapstructure:"secretKey" mdignore:"true"` - SessionToken string `json:"sessionToken"` - Prefix string `json:"prefix"` + SessionToken string `json:"sessionToken" mapstructure:"sessionToken" mdignore:"true"` + + Region string `json:"region" mapstructure:"region" mapstructurealiases:"awsRegion" mdignore:"true"` + Prefix string `json:"prefix"` } type ssmSecretStore struct { diff --git a/state/aws/dynamodb/dynamodb.go b/state/aws/dynamodb/dynamodb.go index fb097df0f2..133c52f43a 100644 --- a/state/aws/dynamodb/dynamodb.go +++ b/state/aws/dynamodb/dynamodb.go @@ -53,7 +53,7 @@ type dynamoDBMetadata struct { SecretKey string `json:"secretKey" mapstructure:"secretKey" mdignore:"true"` SessionToken string `json:"sessionToken" mapstructure:"sessionToken" mdignore:"true"` - Region string `json:"region"` + Region string `json:"region" mapstructure:"region" mapstructurealiases:"awsRegion" mdignore:"true"` Endpoint string `json:"endpoint"` Table string `json:"table"` TTLAttributeName string `json:"ttlAttributeName"` diff --git a/state/aws/dynamodb/metadata.yaml b/state/aws/dynamodb/metadata.yaml index ed0c9a3fbc..dfc7d0ab36 100644 --- a/state/aws/dynamodb/metadata.yaml +++ b/state/aws/dynamodb/metadata.yaml @@ -23,16 +23,6 @@ metadata: The name of the DynamoDB table to use. example: '"Contracts"' type: string - - name: region - required: false - description: | - The AWS region to use. Ensure that DynamoDB is available in that region. - See the `Amazon DynamoDB endpoints and quotas` documentation. - url: - title: Amazon DynamoDB endpoints and quotas - url: https://docs.aws.amazon.com/general/latest/gr/ddb.html - example: '"us-east-1"' - type: string - name: endpoint required: false description: | @@ -56,4 +46,4 @@ metadata: url: https://docs.dapr.io/reference/components-reference/supported-state-stores/setup-dynamodb/#partition-keys example: '"ContractID"' type: string - \ No newline at end of file +