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

Properties with oneOf indicator #99

Closed
ewbankkit opened this issue Aug 13, 2021 · 2 comments · Fixed by #255
Closed

Properties with oneOf indicator #99

ewbankkit opened this issue Aug 13, 2021 · 2 comments · Fixed by #255
Labels
code-generation Relates to the conversion of CloudFormation schema to Terraform schema at buildtime.

Comments

@ewbankkit
Copy link
Contributor

ewbankkit commented Aug 13, 2021

Relates #156

CloudFormation resource schema defined properties may include the oneOf indicator, for example AWS::S3Outposts::Bucket:

    "FilterAndOperator": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "Tags"
          ],
          "properties": {
            "Prefix": {
              "description": "Prefix identifies one or more objects to which the rule applies.",
              "$ref": "#/definitions/FilterPrefix"
            },
            "Tags": {
              "description": "All of these tags must exist in the object's tag set in order for the rule to apply.",
              "type": "array",
              "uniqueItems": true,
              "minItems": 1,
              "items": {
                "$ref": "#/definitions/FilterTag"
              }
            }
          }
        }
      ]
    }

Currently our CloudFormation resource schema SDK ignores the oneOf indicator and when we come to generate a Terraform resource schema for the property it has no type.

It is not currently clear how to handle such properties.

@ewbankkit ewbankkit added code-generation Relates to the conversion of CloudFormation schema to Terraform schema at buildtime. upstream-aws Unable to proceed due to missing or broken functionality from an AWS dependency. and removed upstream-aws Unable to proceed due to missing or broken functionality from an AWS dependency. labels Aug 13, 2021
@ewbankkit
Copy link
Contributor Author

Similarly for AWS::S3ObjectLambda::AccessPoint:

                "ContentTransformation": {
                    "type": "object",
                    "oneOf": [
                        {
                            "additionalProperties": false,
                            "properties": {
                                "AwsLambda": {
                                    "$ref": "#/definitions/AwsLambda"
                                }
                            },
                            "required": [
                                "AwsLambda"
                            ]
                        }
                    ]
                }

@ewbankkit
Copy link
Contributor Author

AWS::S3::StorageLens:

    "Encryption": {
      "description": "Configures the server-side encryption for Amazon S3 Storage Lens report files with either S3-managed keys (SSE-S3) or KMS-managed keys (SSE-KMS).",
      "type": "object",
      "oneOf": [
        {
          "additionalProperties": false,
          "properties": {
            "SSES3": {
              "description": "S3 default server-side encryption.",
              "type": "object",
              "additionalProperties": false
            }
          },
          "required": [
            "SSES3"
          ]
        },
        {
          "additionalProperties": false,
          "properties": {
            "SSEKMS": {
              "$ref": "#/definitions/SSEKMS"
            }
          },
          "required": [
            "SSEKMS"
          ]
        }
      ]
    },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-generation Relates to the conversion of CloudFormation schema to Terraform schema at buildtime.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant