-
Notifications
You must be signed in to change notification settings - Fork 178
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
INTMDB 186 - Added authorization resource to split the cloud access provider config #420
Conversation
Hi @themantissa explaining a little bit about the behavior the cloud_provider_access_setup performs the following operations, this means you can do the setup, is
The authorization resource, is tricky in terraform sense you can create, delete, and update, but mapping to the API.
|
) | ||
} | ||
|
||
func TestAccResourceMongoDBAtlasCloudProviderAccessSetup_importBasic(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pitakill just fyi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks great. Sorry for the delay but had to check some things with others first. Mostly just a few questions/comments and doc edits. Thanks!
Type: schema.TypeString, | ||
Required: true, | ||
}, | ||
// Note: when new providers will be added, this will trigger a recreate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By recreate do you mean that if someone had AWS already and submitted as is for Azure, for example, it would recreate, that is destroy the existing AWS? Or do you mean if a new cloud provider is added it would create a new one in the terraform state? I kinda get what you are saying I think - the way the API is written now it would only really allow one cloud provider at a time to be in use for the project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, if the cloud provider is change from aws to azure, it will hit a force new, that means to delete the existing one (aws) and send a create for azure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any good way to prepare for this to have more than one later? Or should we just punt that to when (if) it actually comes up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Melissa, when it comes we can just add in the Update request, something like if d.HasChanges("provider_name"), get the old and new value (new accepted providers), in case we need extra logic in case it's needed in an update process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Thanks for the clarification.
] | ||
} | ||
EOF | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appears a linter error about not newline at the end of file
access_key = var.access_key | ||
secret_key = var.secret_key | ||
region = var.aws_region | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before about linter error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just fix the linter code from github, if the tests has passed and the code LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One very tiny nit and follow up question. Then I think it's ready!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you! @shum you feel good where this is at? If you don't have the time to review just give it a quick once over and let us know if any questions.
Hi @shum , if you don't have any concern, I will merge this today EOD :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, minor typos but logic makes sense to me
integration-testing/README.md
Outdated
MONGODB_ATLAS_PRIVATE_KEY | ||
``` | ||
|
||
For especific aws related interactions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For especific aws related interactions | |
For specific aws related interactions |
integration-testing/README.md
Outdated
AWS_SECRET_ACCESS_KEY | ||
AWS_REGION | ||
|
||
AWS_CUSTOMER_MASTER_KEY_ID (only cloud at rest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS_CUSTOMER_MASTER_KEY_ID (only cloud at rest) | |
AWS_CUSTOMER_MASTER_KEY_ID (only required for encryption at rest with customer managed keys) |
} else { | ||
// planning for the future multiple providers | ||
return fmt.Errorf(errorGetRead, | ||
fmt.Sprintf("unsopported provider type %s", providerName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Sprintf("unsopported provider type %s", providerName)) | |
fmt.Sprintf("unsupported provider type %s", providerName)) |
Description
Introducing the authorization resource for cloud provider access, the expected behavior is to have the original
Link to any related issue(s):
Type of change:
Required Checklist:
Further comments