public Set<String> getWriteOnlyProperties() {
        return getConstrainedProperties(definition -> {
            Set<CfnResourceIndex.Mutability> mutabilities = definition.getMutabilities();
            // Create and non-read properties need to be set as createOnly and writeOnly.
            if (mutabilities.size() == 1 && mutabilities.contains(CfnResourceIndex.Mutability.CREATE)) {
                return true;
            }

            // Otherwise, create and update, or update only become writeOnly.
            return mutabilities.contains(CfnResourceIndex.Mutability.WRITE)
                    && !mutabilities.contains(CfnResourceIndex.Mutability.READ);
        });
    }
Get write-only property definitions of the CloudFormation resource.

These properties can be specified by the user, but cannot be
returned by a {@code read} or {@code list} request.

@return Returns write-only member names that map to CloudFormation resource
  properties.
smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResource.java