Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing sts to enable an OSD cluster scraper #80

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

suzana-nesic
Copy link
Contributor

Follow up to #74 and #78

Part of APPSRE-6382

main.go Outdated
awsConfig := aws.NewConfig().WithRegion("us-east-1")
sess := session.Must(session.NewSession(awsConfig))
awsAccountId, err := getAwsAccountNumber(logger, sess)
if err != nil {
return collectors, err
}
if pkg.LookUpEnvVar("ROLE_ARN") && pkg.LookUpEnvVar("SESSION_NAME") {
client := sts.New(sess)
err = pkg.AssumeRole(client, roleARN, sessionName, logger)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to refresh the token/session, first you need to introduce the DurationSeconds Parameters for AssumeRole. So we can know how often we should refresh the token. Then, we need to write a loop function that looks like CollectLoop which would run AssumeRole before DurationSeconds comes and recreate all sessions in vpcSessions, rdsSessions, ec2Sessions and r53 session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants