private void updatePropertyMutabilities(
            CfnResource.Builder builder,
            Model model,
            ShapeId resourceId,
            ShapeId operationId,
            StructureShape propertyContainer,
            Set<Mutability> defaultMutabilities,
            Function<Set<Mutability>, Set<Mutability>> updater
    ) {
        // Handle the @excludeProperty trait.
        propertyContainer.accept(new ExcludedPropertiesVisitor(model))
                .forEach(builder::addExcludedProperty);

        for (MemberShape member : propertyContainer.members()) {
            // We've explicitly set identifier mutability based on how the
            // resource instance comes about, so only handle non-identifiers.
            if (inputOperationMemberIsIdentifier(model, resourceId, operationId, member)) {
                continue;
            }

            String memberName = member.getMemberName();
            Set<Mutability> explicitMutability = getExplicitMutability(model, member);

            // Set the correct mutability for if this is a new property.
            Set<Mutability> mutabilities = !explicitMutability.isEmpty()
                    ? explicitMutability
                    : defaultMutabilities;

            if (builder.hasPropertyDefinition(memberName)) {
                builder.updatePropertyDefinition(memberName,
                        getCfnResourcePropertyUpdater(member, explicitMutability, updater));
            } else {
                builder.putPropertyDefinition(memberName,
                        CfnResourceProperty.builder()
                                .addShapeId(member.getId())
                                .mutabilities(mutabilities)
                                .hasExplicitMutability(!explicitMutability.isEmpty())
                                .build());
            }
        }
    }
Gets the definition of the specified CloudFormation resource.

@param resource ShapeID of a resource
@return The resource definition.
smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResourceIndex.java