Questions tagged [aws-sdk-go]

Use this tag for questions related to the AWS SDK for Go library for Amazon Web Services SDK for the Go programing language.

This tag is for questions related to the AWS SDK for Go library for Amazon Web Services SDK for the Go programing language.

272 questions
29
votes
4 answers

Unmarshal map[string]DynamoDBAttributeValue into a struct

I'm trying to set-up an AWS-lambda using aws-sdk-go that is triggered whenever a new user is added to a certain dynamodb table. Everything is working just fine but I can't find a way to unmarshal a map map[string]DynamoDBAttributeValue like: { …
AndreaM16
  • 3,917
  • 4
  • 35
  • 74
26
votes
3 answers

How to get data from aws Dynamodb with using partition key only?

I am using aws-sdk-go library for DynamoDb connectivity in Golang. My DynamoDb table have a Partition key DeviceId (String) and a Sort Key Time (Number). How can I write GetItemInput to get all data with a specific DeviceId? params :=…
user6681013
21
votes
6 answers

How to run AWS SDK with credentials from variables?

I used environment variables before and it worked fine. Now I am migrating my config variables into a single file and I have AWS_SECRET_ACCESS_KEY and AWS_ACCESS_KEY_ID variables containing respective values that are loaded from this file. I tried…
Sergei Basharov
  • 51,276
  • 73
  • 200
  • 335
13
votes
5 answers

How to support more than one trigger in AWS Lambda in Golang?

I am building an AWS Lambda function in Golang that copy the content from n to m S3 buckets. There is a requirement to support for S3 trigger as well as fetching the data from an SQS where all source S3 bucket change is stored. The code can be found…
Mayank Patel
  • 8,088
  • 5
  • 55
  • 75
12
votes
2 answers

Unable to obtain kubeconfig of an AWS EKS cluster in Go code

I have created an AWS EKS cluster. In order to obtain its kubeconfig, I usually run aws eks update-kubeconfig --name cluster-name --region us-west-2 using a shell. However, I now wish to obtain the kubeconfig in Go without having to run anything in…
Armand Grillet
  • 3,229
  • 5
  • 30
  • 60
10
votes
2 answers

How to run AWS SDK version 2 with credentials from variables?

My question is the same as this other question: How to run AWS SDK with credentials from variables? but I am using SDK version 2 which no longer uses Session (if I understand correctly). So, I am creating a new client, and I have the credentials as…
Camilo Urán
  • 387
  • 4
  • 12
10
votes
1 answer

How to save data streams in S3? aws-sdk-go example not working?

I am trying to persist a given stream of data to an S3 compatible storage. The size is not known before the stream ends and can vary from 5MB to ~500GB. I tried different possibilities but did not find a better solution than to implement sharding…
xxorde
  • 896
  • 9
  • 12
9
votes
2 answers

How to force delete all versions of objects in S3 bucket and then eventually delete the entire bucket using aws-sdk-go?

I have an S3 bucket with versioning enabled. The bucket has few files which have versions. I have written a sample golang program which can do the following: GetBucketVersioning - It is able to get bucket versioning status i.e., Enabled ListObjects…
MAK
  • 1,915
  • 4
  • 20
  • 44
9
votes
1 answer

Cannot use "LATEST" (type string) as type *string in field value

I'm trying to run a ECS task using the new aws-sdk-go (v2). And I'm having some trouble to initialize the &ecs.RunTaskInput{} struct. According to the file, this is the struct definition: type RunTaskInput struct { _ struct{}…
user8497169
9
votes
1 answer

HTTP POST to AWS IoT using Golang-AWS-SDK IoTDataPlane

I want to send a message to a MQTT topic via AWS IoT in golang using AWS-SDK via HTTP, when tried with below code it was unsuccessful. The response was : ResourceNotFoundException: Not Found status code: 404, request id:…
Josiah Choi
  • 1,827
  • 1
  • 12
  • 9
7
votes
2 answers

Invalid header field value in Go ONLY on kubernetes/CoreOS

I have a Go program that uses aws-sdk-go to talk to dynamodb. Dependencies are vendored. Go version 1.7.1. aws-sdk-go version 1.6.24. The program works as expected in all the following environments: dev box from shell (Arch Linux) docker…
SjB
  • 213
  • 4
  • 16
6
votes
2 answers

How to get item by key in dynamodb using AWS SDK v2?

I am learning Golang to connect dynamodb using AWS-SDK-GO-V2 but I do not understand how to get one item by key. All example that i saw it is using the v1 but I NEED WITH V2.
Alex Montoya
  • 4,697
  • 1
  • 30
  • 31
6
votes
1 answer

How do I configure S3ForcePathStyle with AWS golang v2 SDK?

I'm putting and reading files to S3 using the AWS golang v2 SDK. Locally I am using local stack and thus need to set the param S3ForcePathStyle. But, I can't find where to set this parameter in the config. This is what my config looks like: conf,…
Freid001
  • 2,580
  • 3
  • 29
  • 60
6
votes
2 answers

dynamodbattribute.MarshalMap returns empty map

I'm attempting to write a really simple Go function to insert an entry into a DynamoDB table. I'm following the tutorial provided on the AWS Documentation site, but for some reason, the function dynamodbattribute.MarshalMap is returning an empty…
6
votes
1 answer

How to Assume Cross-Account Role?

AWS' Golang SDK says that I should use stscreds.AssumeRoleProvider to assume a cross-account role (in this case, for querying another account's DynamoDb table from a web server). This code works: var sess *session.Session func init() { sess =…
Nicholas Carey
  • 71,308
  • 16
  • 93
  • 135
1
2 3
18 19