Skip to content

Commit

Permalink
aws/all: Mark V1 constructors deprecated. (google#3466)
Browse files Browse the repository at this point in the history
  • Loading branch information
vangent authored Aug 13, 2024
1 parent d245f10 commit 526ff45
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions blob/s3blob/s3blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ func openBucket(ctx context.Context, useV2 bool, sess client.ConfigProvider, cli
// AWS buckets are bound to a region; sess must have been created using an
// aws.Config with Region set to the right region for bucketName.
// See the package documentation for an example.
//
// Deprecated: AWS no longer supports their V1 API. Please migrate to OpenBucketV2.
func OpenBucket(ctx context.Context, sess client.ConfigProvider, bucketName string, opts *Options) (*blob.Bucket, error) {
drv, err := openBucket(ctx, false, sess, nil, bucketName, opts)
if err != nil {
Expand Down
8 changes: 8 additions & 0 deletions pubsub/awssnssqs/awssnssqs.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,16 @@ type TopicOptions struct {
}

// OpenTopic is a shortcut for OpenSNSTopic, provided for backwards compatibility.
//
// Deprecated: AWS no longer supports their V1 API. Please migrate to OpenSNSTopicV2.
func OpenTopic(ctx context.Context, sess client.ConfigProvider, topicARN string, opts *TopicOptions) *pubsub.Topic {
return OpenSNSTopic(ctx, sess, topicARN, opts)
}

// OpenSNSTopic opens a topic that sends to the SNS topic with the given Amazon
// Resource Name (ARN).
//
// Deprecated: AWS no longer supports their V1 API. Please migrate to OpenSNSTopicV2.
func OpenSNSTopic(ctx context.Context, sess client.ConfigProvider, topicARN string, opts *TopicOptions) *pubsub.Topic {
if opts == nil {
opts = &TopicOptions{}
Expand Down Expand Up @@ -747,6 +751,8 @@ type sqsTopic struct {

// OpenSQSTopic opens a topic that sends to the SQS topic with the given SQS
// queue URL.
//
// Deprecated: AWS no longer supports their V1 API. Please migrate to OpenSQSTopicV2.
func OpenSQSTopic(ctx context.Context, sess client.ConfigProvider, qURL string, opts *TopicOptions) *pubsub.Topic {
if opts == nil {
opts = &TopicOptions{}
Expand Down Expand Up @@ -1110,6 +1116,8 @@ type SubscriptionOptions struct {
// OpenSubscription opens a subscription based on AWS SQS for the given SQS
// queue URL. The queue is assumed to be subscribed to some SNS topic, though
// there is no check for this.
//
// Deprecated: AWS no longer supports their V1 API. Please migrate to OpenSubscriptionV2.
func OpenSubscription(ctx context.Context, sess client.ConfigProvider, qURL string, opts *SubscriptionOptions) *pubsub.Subscription {
if opts == nil {
opts = &SubscriptionOptions{}
Expand Down
2 changes: 2 additions & 0 deletions runtimevar/awsparamstore/awsparamstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ type Options struct {
// Parameter Store returns raw bytes; provide a decoder to decode the raw bytes
// into the appropriate type for runtimevar.Snapshot.Value.
// See the runtimevar package documentation for examples of decoders.
//
// Deprecated: AWS no longer supports their V1 API. Please migrate to OpenVariableV2.
func OpenVariable(sess client.ConfigProvider, name string, decoder *runtimevar.Decoder, opts *Options) (*runtimevar.Variable, error) {
return runtimevar.New(newWatcher(false, sess, nil, name, decoder, opts)), nil
}
Expand Down
2 changes: 2 additions & 0 deletions runtimevar/awssecretsmanager/awssecretsmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ type Options struct {
// Secrets Manager returns raw bytes; provide a decoder to decode the raw bytes
// into the appropriate type for runtimevar.Snapshot.Value.
// See the runtimevar package documentation for examples of decoders.
//
// Deprecated: AWS no longer supports their V1 API. Please migrate to OpenVariableV2.
func OpenVariable(sess client.ConfigProvider, name string, decoder *runtimevar.Decoder, opts *Options) (*runtimevar.Variable, error) {
return runtimevar.New(newWatcher(false, sess, nil, name, decoder, opts)), nil
}
Expand Down
2 changes: 2 additions & 0 deletions secrets/awskms/kms.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ func (o *URLOpener) OpenKeeperURL(ctx context.Context, u *url.URL) (*secrets.Kee
// https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html#find-cmk-id-arn
// for more details.
// See the package documentation for an example.
//
// Deprecated: AWS no longer supports their V1 API. Please migrate to OpenKeeperV2.
func OpenKeeper(client *kms.KMS, keyID string, opts *KeeperOptions) *secrets.Keeper {
if opts == nil {
opts = &KeeperOptions{}
Expand Down

0 comments on commit 526ff45

Please sign in to comment.