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

provider/aws: Add JSON validation to the aws_kms_key resource. #8900

Merged

Conversation

kwilczynski
Copy link
Contributor

This commit adds support for new helper function which is used to
normalise and validate JSON string.

Signed-off-by: Krzysztof Wilczynski krzysztof.wilczynski@linux.com

@kwilczynski
Copy link
Contributor Author

Part of work which began in #8028.

@kwilczynski kwilczynski changed the title Add JSON validation to the aws_kms_key resource. provider/aws: Add JSON validation to the aws_kms_key resource. Sep 17, 2016
@kwilczynski
Copy link
Contributor Author

Acceptance test is passing:

$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSKmsKey_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/14 17:30:35 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSKmsKey_ -timeout 120m
=== RUN   TestAccAWSKmsKey_importBasic
--- PASS: TestAccAWSKmsKey_importBasic (46.64s)
=== RUN   TestAccAWSKmsKey_basic
--- PASS: TestAccAWSKmsKey_basic (56.70s)
=== RUN   TestAccAWSKmsKey_policy
--- PASS: TestAccAWSKmsKey_policy (46.68s)
=== RUN   TestAccAWSKmsKey_isEnabled
--- PASS: TestAccAWSKmsKey_isEnabled (527.79s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    677.830s

@@ -143,7 +144,8 @@ func resourceAwsKmsKeyRead(d *schema.ResourceData, meta interface{}) error {
return err
}

d.Set("policy", normalizeJson(*p.Policy))
policy, _ := normalizeJsonString(*p.Policy)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to check for any errors here?

@kwilczynski kwilczynski force-pushed the feature/json-validation-aws_kms_key branch from 7ff7ad2 to b54aaf4 Compare September 21, 2016 18:38
@kwilczynski kwilczynski changed the title provider/aws: Add JSON validation to the aws_kms_key resource. [WIP] provider/aws: Add JSON validation to the aws_kms_key resource. Sep 21, 2016
This commit adds support for new helper function which is used to
normalise and validate JSON string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
@kwilczynski kwilczynski force-pushed the feature/json-validation-aws_kms_key branch from b54aaf4 to 7d77048 Compare September 22, 2016 07:49
@kwilczynski kwilczynski changed the title [WIP] provider/aws: Add JSON validation to the aws_kms_key resource. provider/aws: Add JSON validation to the aws_kms_key resource. Sep 22, 2016
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
@kwilczynski kwilczynski force-pushed the feature/json-validation-aws_kms_key branch from 7d77048 to 8f68981 Compare September 22, 2016 08:02
@stack72
Copy link
Contributor

stack72 commented Sep 22, 2016

LGTM! Thanks for the work here :)

% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSKmsKey_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/22 09:16:33 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSKmsKey_ -timeout 120m
=== RUN   TestAccAWSKmsKey_importBasic
--- PASS: TestAccAWSKmsKey_importBasic (56.41s)
=== RUN   TestAccAWSKmsKey_basic
--- PASS: TestAccAWSKmsKey_basic (68.63s)
=== RUN   TestAccAWSKmsKey_policy
--- PASS: TestAccAWSKmsKey_policy (55.11s)
=== RUN   TestAccAWSKmsKey_isEnabled
--- PASS: TestAccAWSKmsKey_isEnabled (298.81s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    478.973s

@stack72 stack72 merged commit c5afc1a into hashicorp:master Sep 22, 2016
@ghost
Copy link

ghost commented Apr 22, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants