Skip to content

Commit

Permalink
fix: drop duplicate awsRegion/region field (#3490)
Browse files Browse the repository at this point in the history
Signed-off-by: Eileen Yu <eileenylj@gmail.com>
  • Loading branch information
Eileen-Yu authored Jul 25, 2024
1 parent beb3f8f commit a409bc1
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .build-tools/builtin-authentication-profiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions bindings/aws/s3/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -75,4 +69,4 @@ metadata:
When connecting to `https://` endpoints, accepts self-signed or invalid certificates.
type: bool
default: 'false'
example: '"true", "false"'
example: '"true", "false"'
2 changes: 1 addition & 1 deletion bindings/aws/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion bindings/postgres/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ metadata:
- "exec"
- "simple_protocol"
example: "cache_describe"
default: ""
default: ""
2 changes: 1 addition & 1 deletion configuration/postgres/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ metadata:
- "exec"
- "simple_protocol"
example: "cache_describe"
default: ""
default: ""
2 changes: 1 addition & 1 deletion pubsub/aws/snssqs/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down
12 changes: 1 addition & 11 deletions pubsub/aws/snssqs/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -143,4 +133,4 @@ metadata:
description: |
The AWS account ID. Resolved automatically if not provided.
example: '""'
type: string
type: string
16 changes: 1 addition & 15 deletions secretstores/aws/parameterstore/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
type: string
8 changes: 5 additions & 3 deletions secretstores/aws/parameterstore/parameterstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion state/aws/dynamodb/dynamodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
12 changes: 1 addition & 11 deletions state/aws/dynamodb/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -56,4 +46,4 @@ metadata:
url: https://docs.dapr.io/reference/components-reference/supported-state-stores/setup-dynamodb/#partition-keys
example: '"ContractID"'
type: string


0 comments on commit a409bc1

Please sign in to comment.