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

Parsing issues #2

Closed
atward opened this issue Feb 28, 2019 · 1 comment
Closed

Parsing issues #2

atward opened this issue Feb 28, 2019 · 1 comment

Comments

@atward
Copy link

atward commented Feb 28, 2019

Given examples here:

 {
     "Version": "2012-10-17",
     "Id": "PutObjPolicy",
     "Statement": [
           {
                "Sid": "DenyIncorrectEncryptionHeader",
                "Effect": "Deny",
                "Principal": "*",
                "Action": "s3:PutObject",
                "Resource": "arn:aws:s3:::<bucket_name>/*",
                "Condition": {
                        "StringNotEquals": {
                               "s3:x-amz-server-side-encryption": "AES256"
                         }
                }
           },
           {
                "Sid": "DenyUnEncryptedObjectUploads",
                "Effect": "Deny",
                "Principal": "*",
                "Action": "s3:PutObject",
                "Resource": "arn:aws:s3:::<bucket_name>/*",
                "Condition": {
                        "Null": {
                               "s3:x-amz-server-side-encryption": true
                        }
               }
           }
     ]
 }

1st, does not recognise Principal:*

unable to convert: json: cannot unmarshal string into Go struct field jsonStatement.Principal of type map[string]converter.stringOrStringArray

2nd, does not convert json booleans to terraform strings

    condition {
      test     = "Null"
      variable = "s3:x-amz-server-side-encryption"
      values   = [""]
    }
flosell added a commit that referenced this issue Mar 2, 2019
@flosell
Copy link
Owner

flosell commented Mar 2, 2019

Thanks for the report! Fixed and released as release 1.2.0

@flosell flosell closed this as completed Mar 2, 2019
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

No branches or pull requests

2 participants