-
Notifications
You must be signed in to change notification settings - Fork 189
INTMDB-133: Examples for encryption at rest with roles #369
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
Conversation
@nikhil-mongo would you be able to take a look at this example and review it? It's for the recent add of IAM roles and the upcoming change for new use to go from IAM user to IAM roles. |
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.
Please add the attributes for accesskey and secret key
Error: error creating Encryption at Rest: PATCH https://cloud.mongodb.com/api/atlas/v1.0/groups/5dd0f66379358e17e49d6c40/encryptionAtRest: 400 (request "Bad Request") The required attribute accessKeyID was not specified.
on atlas-encryption.tf line 1, in resource "mongodbatlas_encryption_at_rest" "test":
1: resource "mongodbatlas_encryption_at_rest" "test" {
atlas-encryption.tf
resource "mongodbatlas_encryption_at_rest" "test" {
project_id = var.project_id
aws_kms = {
access_key_id = var.access_key
secret_access_key = var.secret_key
enabled = true
customer_master_key_id = var.customer_master_key
region = var.atlas_region
role_id = var.cpa_role_id
}
}
Hi @nikhil-mongo , it seems the error is because is not getting the current "version" aka binary, if you don't indicate to use certain version locally it will get from terraform website which is not updated/released yet, so in order to use locally you need to generate the binary first with |
@coderGo93 I have developed the provider by cloning the master branch and using it from inside ~/.terraform.d/plugins. |
Understood @nikhil-mongo , will add those attributes then, thank you!! |
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.
@coderGo93 Please run terraform fmt
in the second step
directory. Rest LGTM.
@nikhil-mongo thank you! If you are good can you approve this PR? |
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.
Approved
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.
@coderGo93 so Nik approved the example in the examples directly but there are 1700+ files in this repo. Can we just do the examples, then do a PR just for the integration-testing add (so if anyone needs the bigger test for IAM they have it) and then ensure there's no provider related code in here (there is currently).
.github/workflows/automated-test.yml
Outdated
@@ -19,4 +19,17 @@ jobs: | |||
- name: Test |
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.
I don't think this should be in the PR.
d13dacf
to
ac4022f
Compare
ac4022f
to
324b940
Compare
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
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, sorry for the delay on my part!
Description
To use terratest locally you need to generate the binary first with
go install
, then plugin will find the binary by following this information Plugin locations otherwise it will get the plugin from terraform registry website.To run certain test with terratest you can go to directory of
integration-testing
and rungo test -v -run TestTerraformResourceMongoDBAtlasEncryptionAtRestWithRole_basicAWS
Link to any related issue(s):
Type of change:
Required Checklist:
Further comments