Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 12 01:12
    techotron commented #1201
  • Jun 11 22:15

    skmcgrail on main

    Release 2021-06-11 (compare)

  • Jun 11 21:19

    skmcgrail on main

    Update Service API Models (#129… (compare)

  • Jun 11 21:19
    skmcgrail closed #1299
  • Jun 10 21:28
    skmcgrail synchronize #1299
  • Jun 10 18:11
    skmcgrail opened #1299
  • Jun 10 18:11
    skmcgrail review_requested #1299
  • Jun 10 17:00
    skmcgrail unlabeled #1296
  • Jun 10 13:41
    saj commented #1253
  • Jun 10 07:53
    iliacimpoes opened #1298
  • Jun 10 01:55
    saj commented #1253
  • Jun 10 00:05
    github-actions[bot] unlabeled #1295
  • Jun 09 23:57
    saj commented #1253
  • Jun 09 22:16
    skotambkar edited #1263
  • Jun 09 22:10
    skotambkar synchronize #1263
  • Jun 09 18:17
    skotambkar review_requested #1263
  • Jun 09 18:14
    skotambkar synchronize #1263
  • Jun 09 16:50
    bdavid21wnec edited #1297
  • Jun 09 05:23
    kisscelia commented #1295
  • Jun 09 05:23
    kisscelia commented #1295
Erik Müller
@asterikx

Hi there, can anyone show me how to create a presigned upload url using v0.26.0 that I can then distribute to web clients to upload images to s3? Previously I had:

req, _ := svc.GetObjectRequest(&s3.GetObjectInput{
    Bucket: aws.String("MY_BUCKET"),
    Key:    aws.String("a-key"),
})
return req.Presign(300*time.Second)

In v0.26.0 the GetObjectRequest has been removed. There is only GetObject but that one does not return a request object ready to be signed. I appreciate any help!

Иван Сердюк
@oceanfish81_twitter
Is there any was to build the whole SDK project (with all dependencies) inside a VM, by not involving containers?
Ichinose Shogo
@shogo82148
Are AWS engineers on Gitter?
Ben Waters
@thebenwaters
Anyone have ideas on this?
github.com/aws/aws-sdk-go-v2/aws/endpoints: module github.com/aws/aws-sdk-go-v2@latest found (v0.26.0), but does not contain package github.com/aws/aws-sdk-go-v2/aws/endpoints
Ichinose Shogo
@shogo82148
Ben Waters
@thebenwaters
Thanks @shogo82148
Jeff
@jcarter3
so as of v0.26.0, all paginators are gone?
Promaethius
@Promaethius
@thebenwaters do you have a working example on using endpoints?
Jeff
@jcarter3
what version were you using when the endpoints did work?
Promaethius
@Promaethius
I'm used to the v1 sdk where the endpoint resolver is passed as a function in with a general config, trying to migrate
rfc2119
@rfc2119
v0.26.0 breaks a lot of stuff. Since this chat room is not active, anyone know where do gophers using the SDK hang out ?
Jeff
@jcarter3
@rfc2119 yes it does... took a couple days to fix all the errors (though my project is probably not normal)
Alban B
@aboitier_gitlab
@rfc2119 good question
ranamuerta
@ranamuerta
is v.0.29.0 safe to use? i have many middleware dependency issues.
../../../../pkg/mod/github.com/aws/aws-sdk-go-v2/service/sts@v0.29.0/api_op_AssumeRole.go:326:2: undefined: "github.com/aws/aws-sdk-go-v2/aws/middleware".AddRequestInvocationIDMiddleware
Dre
@dre2004
is "github.com/aws/aws-sdk-go-v2/aws/external" broken? I get ain.go:8:2: module github.com/aws/aws-sdk-go-v2@latest found (v0.29.0), but does not contain package github.com/aws/aws-sdk-go-v2/aws/external or is the documentation out of date?
Ichinose Shogo
@shogo82148
which documentation?
AWS introduced big breaking changes into v0.25.0. aws/external is renamed to aws/config. https://github.com/aws/aws-sdk-go-v2/blob/master/CHANGELOG.md#relocated-packages
I guess a lot of it seems out of date, the config package isn't there
Ichinose Shogo
@shogo82148
yes, it is out of date. it looks that it doesn't contain the changes of v0.25.0. v0.25.0 breaks many and many things...
JaeHoon Kim
@LumpKim
Hello, I have a question about types.BucketLocationConstraint.
When I call s3.Client.GetBucketLocation and print s3.GetBucketLocationOutput.BucketLocationConstraint, it shows nothing.
Is there any solutions? aws-sdk-go-v2 documentation always says about v1!
Jeff
@jcarter3
@LumpKim i don't believe there is a workaround for this yet, I think it's broken at the generation-via-smithy level
JaeHoon Kim
@LumpKim
Thanks @jcarter3
Andy Spence
@AndySpe85815249_twitter
Not getting this example snippet: aws.EndpointResolverFunc(func(service, region string) (aws.Endpoint, error) {} - service does not have a Type ? https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/endpoints/
This-Is-Not-Brad
@This-Is-Not-Brad
I'm having great difficulty getting v4 signing working since the 0.25.0 changes. Doing a basic GET to an IAM authorised Lambda. Are their any updated examples? All the documentation\resources I can find appear to be for <0.25.0
Julio Chana
@jchanam
Hi!
I'm developing some tools with the SDK and I'd like to know if there's documentation in some places about the possible errors that a call could give. I'm using the errors.As to check if the error given is a specific one but sometimes I can't know the kind to expect.
1 reply
Kaveh Shahbazian
@dc0d
Is there an example of how to use AWS SDK v2 for implementing a lambda function?
Milos Gajdos
@milosgajdos
is there a guide how to get the java cruft used for codegen in V2 working?
I've been fighting with it for a few hours here and then and keep getting this error
$ make smithy-generate
cd codegen && ./gradlew clean build -Plog-tests && ./gradlew clean
/Users/milosgajdos/go/src/github.com/aws/aws-sdk-go-v2/codegen

> Configure project :protocol-test-codegen
(scanned and found a Smithy CLI version 1.5.1. You will need to add an explicit dependency on smithy-model if publishing a JAR)

> Configure project :sdk-codegen
(scanned and found a Smithy CLI version 1.5.1. You will need to add an explicit dependency on smithy-model if publishing a JAR)

> Task :smithy-aws-go-codegen:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':smithy-aws-go-codegen:compileJava'.
> Could not resolve all files for configuration ':smithy-aws-go-codegen:compileClasspath'.
   > Could not find software.amazon.smithy:smithy-go-codegen:0.1.0.
     Searched in the following locations:
       - file:/Users/milosgajdos/.m2/repository/software/amazon/smithy/smithy-go-codegen/0.1.0/smithy-go-codegen-0.1.0.pom
       - https://repo.maven.apache.org/maven2/software/amazon/smithy/smithy-go-codegen/0.1.0/smithy-go-codegen-0.1.0.pom
     Required by:
         project :smithy-aws-go-codegen

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1s
4 actionable tasks: 1 executed, 3 up-to-date
make: *** [smithy-generate] Error 1
Milos Gajdos
@milosgajdos
Originally I thought it was because smithy-go-codegen version seemed too low i.e. above you can see it uses 0.1.0 whilst it seems (according to GH tags it should be 1.0.0, but even changing the gradle settings didn't help)
Kristoffer Ahl
@kristofferahl

Hey all! I've been trying to do the following against Route53 with the v2 SDK ...

  1. Create a Hosted Zone for a subdomain ("subdomain1.app.example.com")
  2. Add NS record for subdomain1 to the parent Hosted Zone ("app.example.com")

Creating the Hosted Zone for the subdomain is no problem but adding the NS record fails with the following error message:
InvalidInput: Invalid request: Expected exactly one of [Weight, Region, Failover, GeoLocation, or MultiValueAnswer], but found none in Change with [Action=UPSERT, Name=subdomain1.apps.example.com., Type=NS, SetIdentifier=Upsert NS record]

If I use the AWS Management Console to add the NS record, I do not need to specify any of the above and it works great. What is the proper way of adding an NS record to a Hosted Zone? Can't find any examples out there for NS records.
Here's the code snippet I'm working with:

params := route53.ChangeResourceRecordSetsInput{
    ChangeBatch: &types.ChangeBatch{
        Changes: []types.Change{
            {
                Action: types.ChangeActionUpsert,
                ResourceRecordSet: &types.ResourceRecordSet{
                    Name:            "subdomain1.app.example.com",
                    Type:            types.RRTypeNs,
                    ResourceRecords: []types.ResourceRecord{
                        ... values goes here ...
                    },
                    TTL:             aws.Int64(300),
                    SetIdentifier:   aws.String("Upsert NS record"),
                },
            },
        },
        Comment: aws.String("Upserting NS record in parent zone"),
    },
    HostedZoneId: aws.String("<id of parent zone app.example.com>"),
}
res, err := r.Route53.ChangeResourceRecordSets(ctx, &params)

Any help would be much appreciated!

BTW. r.Route53 is the route53.Client ...
Kid Hailu
@kidanekal

Hello,

I have a service written by using go sdk 1.X and planning to convert it to go-sdk 2, the service has a test that uses the 1.x interfaces for example "github.com/aws/aws-sdk-go/service/ec2/ec2iface and instantiate objects to mock the service in the test.

My question is

  1. What is the reasoning behind removing the *iface interfaces from aws services in v2.0? The change makes mocking and testing a bit difficult.
1 reply
The interface was easier to mock and do the testing -- https://github.com/aws/aws-sdk-go/blob/master/service/ec2/ec2iface/interface.go
Kristoffer Ahl
@kristofferahl
If anyone is interested, removing SetIdentifier: aws.String("Upsert NS record"), solved it for me. NS records should be created as a "simple" record type.
Tyler Dockstader
@tydock88_twitter

hello everyone, I am trying to disable sourcedestcheck on the ENI level, this block of code works if SourceDestCheck: is true, but says api error InvalidParameterCombination: No attributes specified. if SourceDestCheck: is false, I am stuck on how to disable SourceDestCheck

``` input := &ec2.ModifyNetworkInterfaceAttributeInput{
NetworkInterfaceId: aws.String(eni),
SourceDestCheck: &types.AttributeBooleanValue{
Value: false,
},
}

_, err := client.ModifyNetworkInterfaceAttribute(context.Background(), input)
```

Tyler Dockstader
@tydock88_twitter
am I running into some sort of bug with the sdk?
bhargavak
@kbhagi
Folks , trying to Set Handler for the function here using Golang v2
AWS public facing documentation for DynamoDb doesn't tell how to wrap it using an Handler for Lambda function

package main

import (
"context"
"fmt"
"log"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
"github.com/aws/aws-sdk-go-v2/service/lambda"

)

var client dynamodb.Client

func init() {
// Using the SDK's default configuration, loading additional config
// and credentials values from the environment variables, shared
// credentials, and shared configuration files
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion("eu-central-1"))
if err != nil {
log.Fatalf("unable to load SDK config, %v", err)
}

// Using the Config value, create the DynamoDB client
client := dynamodb.NewFromConfig(cfg)

}
func TablesOperation() {

// Build the request with its input parameters
resp, err := client.ListTables(context.TODO(), &dynamodb.ListTablesInput{
    Limit: aws.Int32(5),
})
if err != nil {
    log.Fatalf("failed to list tables, %v", err)
}

fmt.Println("Tables:")
for _, tableName := range resp.TableNames {
    fmt.Println(tableName)
}

}

func main() {
// xray.AWS(dbSession.Client)
lambda.CreateFunctionInput(Handler * TablesOperation)

}

bhargavak
@kbhagi
@jasdel How to set an handler for Golang SDK v2 targeted towards Lambda functions
jamielaux
@jamielaux

@kbhagi

aws has a lib called go-api-proxy
that you can use to wrap a lambda to respond to a normal http interface

below is an example with gorilla mux

package main

import (
    "context"

    "github.com/aws/aws-lambda-go/events"
    "github.com/aws/aws-lambda-go/lambda"

    "github.com/awslabs/aws-lambda-go-api-proxy/gorillamux"
    "github.com/gorilla/mux"
)

var adaptor *gorillamux.GorillaMuxAdapter

func init() {
    r := mux.NewRouter()
    r.HandleFunc("/", YOURHANDLER).Methods("POST")

    adaptor = gorillamux.New(r)
}

func main() {
    lambda.Start(func(ctx context.Context, req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
        return adaptor.ProxyWithContext(ctx, req)
    })
}
Sam Perrin
@speza
Hello :wave: I'm looking to add generic tracing in for aws-sdk-go-v2 (similar to https://github.com/DataDog/dd-trace-go/tree/v1/contrib/aws/aws-sdk-go/aws). Before I dive in, I wondered if anyone here could recommended a way that is nice and generic given the v2 SDK structure? Possibly middleware?
1 reply
jamielaux
@jamielaux
@speza you can also check out amazons own tracing service xray https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-go-awssdkclients.html
to see how they do it
while not v2 it may help for reference https://github.com/aws/aws-xray-sdk-go
Sam Perrin
@speza
Thanks @jamielaux I will check it out :)
pradeepp28
@pradeepp28
Currently I am using aws s3manager BatchUploadIterator to upload all files we have in multipart form, how do we do this in aws-sdk-go-v2?
I searched the documentation, couldn't find the similar one in aws-sdk-go-v2
Federico Ragona
@fedragon
Hi everybody, I just upgraded to v2 and I have some tests which are now failing: these tests spin up a localstack instance, create a Kinesis stream, and then put some records into it. They work fine locally but fail in my pipeline, where I'm using a remote DOCKER_HOST. This is how I have configured it so far. I'm making sure to replace the endpoint and region according to my configuration (as much as I could find on the documentation, at least) but CreateStream fails with context deadline exceeded. Has anyone encountered similar issues?
import (
  "github.com/aws/aws-sdk-go-v2/aws"
  "github.com/aws/aws-sdk-go-v2/config"
  "github.com/aws/aws-sdk-go-v2/service/kinesis"
  "github.com/aws/aws-sdk-go-v2/service/kinesis/types"
  "github.com/aws/smithy-go"
)

var (
  kinesisStreamName             = aws.String("my-stream")
  kinesisRegion                          = "eu-west-1"
  kinesisShardsCount int32 = 1
)

func TestIt(t *testing.T) {
  endpointResolver := aws.EndpointResolverFunc(func(service, region string) (aws.Endpoint, error) {
    if service == kin.ServiceID && region == kinesisRegion {
      return aws.Endpoint{
        PartitionID:   "aws",
        URL:           kinesisEndpoint,
        SigningRegion: kinesisRegion,
      }, nil
    }
    return aws.Endpoint{}, fmt.Errorf("unknown endpoint requested")
  })

  cfg, err := config.LoadDefaultConfig(context.Background(), config.WithRegion(kinesisRegion), config.WithEndpointResolver(endpointResolver))
  if err != nil {
    logAwsError(s.t, "unable to load AWS configuration", err)
  }

  client := kinesis.NewFromConfig(cfg)

  ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
  defer cancel()

  _, err := s.testKinesisClient.CreateStream(ctx, &kin.CreateStreamInput{
    StreamName: kinesisStreamName,
    ShardCount: &kinesisShardsCount,
  })
  if err != nil {
    logAwsError(s.t, "unable to create Kinesis stream", err)
  }
}