From 5f07427605c21530f5096db90368bc9074a8a151 Mon Sep 17 00:00:00 2001 From: Kevin Stich Date: Thu, 1 Aug 2024 13:58:58 -0700 Subject: [PATCH] Fix legacy arn trait name usage --- .../software/amazon/smithy/aws/traits/ArnIndex.java | 12 ++++++------ .../amazon/smithy/aws/traits/ServiceTrait.java | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ArnIndex.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ArnIndex.java index cf87739c3bb..a1f5e1d7fc9 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ArnIndex.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ArnIndex.java @@ -51,7 +51,7 @@ public ArnIndex(Model model) { arnServices.put(service.getId(), service.expectTrait(ServiceTrait.class).getArnNamespace()); } - // Pre-compute all of the ArnTemplates in a service shape. + // Pre-compute all of the ARN templates in a service shape. TopDownIndex topDownIndex = TopDownIndex.of(model); List services = model.shapes(ServiceShape.class) .filter(shape -> shape.hasTrait(ServiceTrait.class)) @@ -126,10 +126,10 @@ public String getServiceArnNamespace(ToShapeId serviceId) { /** * Gets all of the mappings of resources within a service to its - * arnTemplate trait. + * arn trait. * * @param service Service to retrieve. - * @return Returns the mapping of resource ID to arnTemplate traits. + * @return Returns the mapping of resource ID to arn traits. */ public Map getServiceResourceArns(ToShapeId service) { return templates.getOrDefault(service.toShapeId(), Collections.emptyMap()); @@ -160,10 +160,10 @@ public Optional getEffectiveOperationArn(ToShapeId service, ToShapeId *

For relative ARNs, the returned template string is in the format of * arn:{AWS::Partition}:service:{AWS::Region}:{AWS::AccountId}:resource * where "service" is the resolved ARN service name of the service and - * "resource" is the resource part of the arnTemplate template. - * "{AWS::Region}" is added to the template if the arnTemplate "noRegion" + * "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 arnTemplate "noAccount" value is not set to true. + * the arn "noAccount" value is not set to true. * *

For example, if both "noAccount" and "noRegion" are set to true, * the resolved ARN template might look like "arn:{AWS::Partition}:service:::resource". diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ServiceTrait.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ServiceTrait.java index d56938b5ad5..b8b49147a06 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ServiceTrait.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ServiceTrait.java @@ -105,7 +105,7 @@ public static Builder builder() { *

If not set, this value defaults to the name of the service shape * converted to lowercase. This value is combined with resources contained * within the service to form ARNs for resources. Only resources that - * explicitly define the 'aws.api#arnTemplate' trait are assigned ARNs, + * explicitly define the 'aws.api#arn' trait are assigned ARNs, * and their relative ARNs are combined with the service's arnNamespace to * form an ARN. *