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

feat: adds more environment variables to be used when authenticating with an AWS Role #1551

Conversation

marcosuma
Copy link
Collaborator

@marcosuma marcosuma commented Oct 24, 2023

Adds two more environment variables ASSUME_ROLE_ARN and SECRET_NAME as values from which it is possible to set a default in the provider configuration (to be used for AWS Role-based authentication).

Related to: https://jira.mongodb.org/browse/INTMDB-1034

Description

Please include a summary of the fix/feature/change, including any relevant motivation and context.

Link to any related issue(s):

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contribution guidelines
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals, I defined an isolated PR with a relevant title as it will be used in the auto-generated changelog.

Further comments

@marcosuma marcosuma changed the title feat: set all possible default values taken from environment varialbes (if … feat: adds more environment variables to be used when authenticating with an AWS Role Oct 24, 2023
@marcosuma marcosuma marked this pull request as ready for review October 24, 2023 12:51
@marcosuma marcosuma requested a review from a team as a code owner October 24, 2023 12:51
Copy link
Member

@AgustinBettati AgustinBettati left a comment

Choose a reason for hiding this comment

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

small improvements, change LGMT

mongodbatlas/fw_provider.go Outdated Show resolved Hide resolved
mongodbatlas/fw_provider.go Outdated Show resolved Hide resolved
mongodbatlas/provider.go Outdated Show resolved Hide resolved
mongodbatlas/provider.go Outdated Show resolved Hide resolved
marcosuma and others added 3 commits October 26, 2023 11:46
* adds test coverage.

* pre-check that regular credentials env variables are not set.

* feat: adds test infrastructure to run acceptance tests on PRs (#1553)

* adds test infra.

* fix.
Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>
Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>
@github-actions
Copy link
Contributor

Code Coverage

Package Line Rate Health
github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas 2%
github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas/framework/validator 68%
github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas/util 17%
Summary 3% (272 / 10318)

@marcosuma marcosuma merged commit 2d4d28f into INTMDB-1034-fix-aws-region-env-variable-bug Oct 26, 2023
21 checks passed
@marcosuma marcosuma deleted the INTMDB-1034-set-all-default-values branch October 26, 2023 10:24
marcosuma added a commit that referenced this pull request Oct 30, 2023
* fixed region value when creating configuration for aws role authentication.

* restore go.mod and go.sum.

* separates logic into util func.

* feat: adds more environment variables to be used when authenticating with an AWS Role (#1551)

* set all possible default values taken from environment varialbes (if exist).

* addresses comments.

* feat: adds test coverage for AWS Role Authentication (#1552)

* adds test coverage.

* pre-check that regular credentials env variables are not set.

* feat: adds test infrastructure to run acceptance tests on PRs (#1553)

* adds test infra.

* fix.

* Update mongodbatlas/provider.go

Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>

* Update mongodbatlas/provider.go

Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>

* addresses comments.

---------

Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>

---------

Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>
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.

None yet

3 participants