I'm trying to set the session duration for IRSA credentials to something other than the default of 1 hour.
The WebIdentityRoleProvider allows setting a Duration but this doesn't seem to be exposed in any way through session.
I can create the web identity and provider myself, but all of the loading of env vars is not exposed either.
I really just want a session longer than an hour but this seems to be terribly complicated for some reason.
attachment.device
as your name and /dev/xvda
for your value
type GetApiKeysOutput struct {
// The current page of elements from this collection.
Items []*ApiKey `locationName:"item" type:"list"`
Position *string `locationName:"position" type:"string"`
// A list of warning messages logged during the import of API keys when the
// failOnWarnings option is set to true.
Warnings []*string `locationName:"warnings" type:"list"`
// contains filtered or unexported fields
}
cr := cf.CreateStackInput{ RoleARN: aws.String(cm.cfg[cloudRoleKey]), ... }
. Now I am trying to read messages off of an SQS queue and see that this is not available. Would I pass a role ARN into session, or do I need to use the credentials
package? Is that possible?
sess := session.Must(session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable,
}))
// Create new EC2 client
ec2Svc := ec2.New(sess)
input := &ec2.DescribeInstancesInput{
InstanceIds: []*string{aws.String(instanceID)},
}
// Call to get detailed information on each instance
result, err := ec2Svc.DescribeInstances(input)
if err != nil {
fmt.Println("Error", err)
} else {
fmt.Println(result)
}
It returns like below:
{
}
I found aws/aws-sdk-go#1449 but it doesn't have a solution.
Any help would be much appreciated.
Are CodeGuru Profiler and Viewer available in Golang?
Nowhere on the homepage showcasing this tool (https://aws.amazon.com/codeguru/) is mentioned support for Golang. But I saw these two SDKs links and I am now confused on whether this actually works with Golang or not
https://docs.aws.amazon.com/sdk-for-go/api/service/codegurureviewer/
https://docs.aws.amazon.com/sdk-for-go/api/service/codeguruprofiler/
package main
import (
// "flag"
"fmt"
"github.com/aws/aws-sdk-go/aws"
// "github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ec2"
log "github.com/sirupsen/logrus"
)
func main() {
var arn string
var region string
region = "us-east-1"
arn="arn:aws:iam::*******:role/*******-role"
sess := session.Must(session.NewSession())
creds := stscreds.NewCredentials(sess, arn)
fmt.Println("This should print the ec2 instances available in your account. If you passed in an ARN, it will print the S3 buckets in the Assumed Role account.")
ec3svc := ec2.New(session.New(), &aws.Config{Credentials: creds, Region: aws.String(region)})
var input *ec2.DescribeInstancesInput
resp, err := ec3svc.DescribeInstances(input)
if err != nil {
fmt.Println("there was an error listing instances in", err.Error())
log.Fatal(err.Error())
}else {
fmt.Println("Success", resp)
}
}
I am getting the below error
there was an error listing instances in InvalidClientTokenId: The security token included in the request is invalid.
status code: 403, request id: 65aa93eb-dd15-46be-8a92-a1e32b6aa1b5
FATA[0000] InvalidClientTokenId: The security token included in the request is invalid.
status code: 403, request id: 65aa93eb-dd15-46be-8a92-a1e32b6aa1b5
Can somebody help to fix this issue...?
DescribeDBClusters
to get the instances that are being run by the Aurora cluster, delete them (DeleteDBInstance
) and then run DeleteDBCluster
to actually delete the cluster. But the problem is I don't see an API that can wait for that cluster to be deleted.