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

catch common resource schema issues in cfn validate #668

Merged
merged 3 commits into from
Jan 21, 2021

Conversation

PatMyron
Copy link
Contributor

@PatMyron PatMyron commented Jan 20, 2021

continuing #663

readOnlyProperties overlapping with required:
AWS::CodeArtifact::Repository.DomainName
AWS::MWAA::Environment.Name
Copy link
Contributor

@johnttompkins johnttompkins left a comment

Choose a reason for hiding this comment

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

Want to add another test schema/modify a test schema for this case? it's kind of overshadowed in its branch because the other conditions trip it

@PatMyron
Copy link
Contributor Author

it's kind of overshadowed in its branch because the other conditions trip it

Yeah, that's why I didn't commit it, but I manually tested with this resource schema:

{
  "typeName" : "AWS::Service::Type",
  "description" : "",
  "additionalProperties" : false,
  "properties" : {
    "Property" : {
      "type" : "string"
    }
  },
  "readOnlyProperties": [
    "/properties/Property"
  ],
  "required": [
    "Property"
  ],
  "primaryIdentifier" : [ "/properties/Property" ]
}
readOnlyProperties cannot be specified by customers and should not overlap with writeOnlyProperties, createOnlyProperties, or required: {'/properties/Property'}

@PatMyron PatMyron merged commit 13dc44a into master Jan 21, 2021
@PatMyron PatMyron deleted the catch-schema-issues branch January 21, 2021 00:10
@PatMyron PatMyron changed the title catch common resource schema issues catch common resource schema issues in cfn validate Jan 27, 2021
@PatMyron PatMyron added the schema Related to the provider meta schema label Feb 3, 2021
) & (
set(resource_spec.get("createOnlyProperties", []))
| set(resource_spec.get("writeOnlyProperties", []))
| {"/properties/" + s for s in resource_spec.get("required", [])}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

think this wouldn't catch nested required properties overlapping with readOnlyProperties

kddejong pushed a commit to kddejong/cloudformation-cli that referenced this pull request Oct 24, 2022
continuing aws-cloudformation#663

readOnlyProperties overlapping with required:
AWS::CodeArtifact::Repository.DomainName
AWS::MWAA::Environment.Name
kddejong pushed a commit to kddejong/cloudformation-cli that referenced this pull request Oct 24, 2022
continuing aws-cloudformation#663

readOnlyProperties overlapping with required:
AWS::CodeArtifact::Repository.DomainName
AWS::MWAA::Environment.Name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
schema processing schema Related to the provider meta schema
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants