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

What is the expected format of readOnlyProperties? #150

Open
gordonmleigh opened this issue Nov 19, 2023 · 1 comment
Open

What is the expected format of readOnlyProperties? #150

gordonmleigh opened this issue Nov 19, 2023 · 1 comment

Comments

@gordonmleigh
Copy link

What is the expected format of readOnlyProperties? There are several examples in the current schemas, shown below. Since this format is an extension of JSON Schema, I'd have expected readOnlyProperties to match required, i.e. just having property names. Instead it has something which looks like a JSON Pointer, but in most cases isn't actually a valid reference.

Are all of the properties listed here supposed to be now accessible with Fn::GetAtt? The last word on this was in 2019 (#59): "supposed to be, but not quite working yet".

Prefixed with /properties/, nested with /

The /properties/ prefix implies that this is a JSON Pointer, but these aren't actually valid references, since the nested property isn't a child of the schema at that location.

E.g. AWS::RDS::DBInstance:

"readOnlyProperties": [
  "/properties/Endpoint/Address",
  "/properties/Endpoint/Port",
  "/properties/Endpoint/HostedZoneId",
  "/properties/DbiResourceId",
  "/properties/DBInstanceArn",
  "/properties/DBSystemId",
  "/properties/MasterUserSecret/SecretArn",
  "/properties/CertificateDetails/CAIdentifier",
  "/properties/CertificateDetails/ValidTill"
],

Prefixed with /properties/, nested with /, contains * wildcards

Also not a valid reference. E.g. AWS::WAFv2::RuleGroup:

"readOnlyProperties": [
  "/properties/Arn",
  "/properties/Id",
  "/properties/LabelNamespace",
  "/properties/AvailableLabels/*/Name",
  "/properties/ConsumedLabels/*/Name"
],

Prefixed with /properties/, nested with .

Also not a valid reference. E.g. AWS::ElastiCache::CacheCluster:

"readOnlyProperties": [
  "/properties/ConfigurationEndpoint.Address",
  "/properties/Id",
  "/properties/ConfigurationEndpoint.Port",
  "/properties/RedisEndpoint.Port",
  "/properties/RedisEndpoint.Address"
],

Prefixed with /Properties/ (uppercase P)

I assume this is a mistake. Only example is AWS::DMS::ReplicationConfig:

"readOnlyProperties": ["/Properties/ReplicationConfigArn"],
@PatMyron
Copy link
Contributor

Started intending to be JSON pointers:

When defining resource semantics like `createOnlyProperties`, `primaryIdentifier` you are expected to use a JSON Pointer to a property definition in the same resource document. Schemas you author can be checked with the CFN CLI `validate` command.

but did diverge to support wildcards:
aws-cloudformation/cloudformation-cli#478 (comment)


(uppercase P is indeed likely a typo. Don't remember enough to weigh in on RDS/ElastiCache examples anymore)

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