Seleccione sus preferencias de cookies

Usamos cookies esenciales y herramientas similares que son necesarias para proporcionar nuestro sitio y nuestros servicios. Usamos cookies de rendimiento para recopilar estadísticas anónimas para que podamos entender cómo los clientes usan nuestro sitio y hacer mejoras. Las cookies esenciales no se pueden desactivar, pero puede hacer clic en “Personalizar” o “Rechazar” para rechazar las cookies de rendimiento.

Si está de acuerdo, AWS y los terceros aprobados también utilizarán cookies para proporcionar características útiles del sitio, recordar sus preferencias y mostrar contenido relevante, incluida publicidad relevante. Para aceptar o rechazar todas las cookies no esenciales, haga clic en “Aceptar” o “Rechazar”. Para elegir opciones más detalladas, haga clic en “Personalizar”.

AWS::XRay::ResourcePolicy

Modo de enfoque
AWS::XRay::ResourcePolicy - AWS CloudFormation
Esta página no se ha traducido a su idioma. Solicitar traducción
Filtrar vista

Use AWS::XRay::ResourcePolicy to specify an X-Ray resource-based policy, which grants one or more AWS services and accounts permissions to access X-Ray. Each resource-based policy is associated with a specific AWS account.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::XRay::ResourcePolicy", "Properties" : { "BypassPolicyLockoutCheck" : Boolean, "PolicyDocument" : String, "PolicyName" : String } }

YAML

Type: AWS::XRay::ResourcePolicy Properties: BypassPolicyLockoutCheck: Boolean PolicyDocument: String PolicyName: String

Properties

BypassPolicyLockoutCheck

A flag to indicate whether to bypass the resource-based policy lockout safety check.

Required: No

Type: Boolean

Update requires: No interruption

PolicyDocument

The resource-based policy document, which can be up to 5kb in size.

Required: Yes

Type: String

Minimum: 1

Maximum: 5120

Update requires: No interruption

PolicyName

The name of the resource-based policy. Must be unique within a specific AWS account.

Required: Yes

Type: String

Pattern: [\w+=,.@-]+

Minimum: 1

Maximum: 128

Update requires: Replacement

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the policy name.

For more information about using the Ref function, see Ref.

Examples

Create resource-based policy

This example creates a resource-based policy called MySnsActiveTracingPolicy, which configures Amazon SNS active tracing.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "MyResourcePolicy": { "Type": "AWS::XRay::ResourcePolicy", "Properties": { "BypassPolicyLockoutCheck": "false", "PolicyDocument": "{ \"Version\": \"2012-10-17\", \"Statement\": [ { \"Sid\": \"SNSAccess\", \"Effect\": \"Allow\", \"Principal\": { \"Service\": \"sns.amazonaws.com\" }, \"Action\": [ \"xray:PutTraceSegments\", \"xray:GetSamplingRules\", \"xray:GetSamplingTargets\" ], \"Resource\": \"*\", \"Condition\": { \"StringEquals\": { \"aws:SourceAccount\": \"my-account-id\" }, \"StringLike\": { \"aws:SourceArn\": \"arn:$my-partition:sns:$my-region:$my-account-id:my-topic-name\" } } } ] }", "PolicyName": "MySnsActiveTracingPolicy" } } } } }

YAML

AWSTemplateFormatVersion: 2010-09-09 Resources: MyResourcePolicy: Type: AWS::XRay::ResourcePolicy Properties: BypassPolicyLockoutCheck: false PolicyDocument: "{ \"Version\": \"2012-10-17\", \"Statement\": [ { \"Sid\": \"SNSAccess\", \"Effect\": \"Allow\", \"Principal\": { \"Service\": \"sns.amazonaws.com\" }, \"Action\": [ \"xray:PutTraceSegments\", \"xray:GetSamplingRules\", \"xray:GetSamplingTargets\" ], \"Resource\": \"*\", \"Condition\": { \"StringEquals\": { \"aws:SourceAccount\": \"my-account-id\" }, \"StringLike\": { \"aws:SourceArn\": \"arn:$my-partition:sns:$my-region:$my-account-id:my-topic-name\" } } } ] }" PolicyName: "MySNSActiveTracingPolicy"

See also

En esta página

PrivacidadTérminos del sitioPreferencias de cookies
© 2025, Amazon Web Services, Inc o sus afiliados. Todos los derechos reservados.