public Optional<String> getFullResourceArnTemplate(ToShapeId service, ToShapeId resource) {
        return Optional.ofNullable(getServiceResourceArns(service).get(resource.toShapeId()))
                .map(trait -> {
                    StringBuilder result = new StringBuilder();
                    if (!trait.isAbsolute()) {
                        result.append("arn:")
                                .append("{AWS::Partition}:")
                                .append(getServiceArnNamespace(service))
                                .append(":");
                        if (!trait.isNoRegion()) {
                            result.append("{AWS::Region}");
                        }
                        result.append(":");
                        if (!trait.isNoAccount()) {
                            result.append("{AWS::AccountId}");
                        }
                        result.append(":");
                    }

                    return result.append(trait.getTemplate()).toString();
                });
    }
Expands the relative ARN of a resource with the service name to form a
full ARN template.

<p>For relative ARNs, the returned template string is in the format of
<code>arn:{AWS::Partition}:service:{AWS::Region}:{AWS::AccountId}:resource</code>
where "service" is the resolved ARN service name of the service and
"resource" is the resource part of the arn template.
"{AWS::Region}" is added to the template if the arn "noRegion"
value is not set to true. "{AWS::AccountId}" is added to the template if
the arn "noAccount" value is not set to true.

<p>For example, if both "noAccount" and "noRegion" are set to true,
the resolved ARN template might look like "arn:{AWS::Partition}:service:::resource".

<p>Absolute ARN templates are returned as-is.

@param service Service shape ID.
@param resource Resource shape ID.
@return Returns the optionally found ARN template for a resource.
smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ArnIndex.java