문자열 값 일치 - Amazon Simple Notification Service

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

문자열 값 일치

문자열 값을 메시지 속성 값이나 메시지 본문 속성 값과 일치시켜 메시지를 필터링할 수 있습니다. 문자열 값은 JSON 정책에서 큰따옴표로 묶습니다. 다음 문자열 작업을 사용하여 메시지 속성 또는 메시지 본문을 일치시킬 수 있습니다.

정확한 일치

정책 속성 값이 하나 이상의 메시지 속성 값과 일치하는 경우 정확한 일치가 발생합니다.

다음 정책 속성을 살펴보겠습니다.

"customer_interests": ["rugby", "tennis"]

이 속성은 다음 메시지 속성과 일치합니다.

"customer_interests": {"Type": "String", "Value": "rugby"}
"customer_interests": {"Type": "String", "Value": "tennis"}

또한 다음 메시지 본문과도 일치합니다.

{ "customer_interests": "rugby" }
{ "customer_interests": "tennis" }

그러나 다음 메시지 속성과는 일치하지 않습니다.

"customer_interests": {"Type": "String", "Value": "baseball"}

다음 메시지 본문과도 일치하지 않습니다.

{ "customer_interests": "baseball" }

Anything-but 일치

정책 속성 값에 키워드 anything-but가 포함되어 있으면 정책 속성 값을 포함하지 않는 모든 메시지 속성 또는 메시지 본문 값과 일치합니다. anything-but"exists": false와 함께 사용할 수 있습니다.

다음 정책 속성을 살펴보겠습니다.

"customer_interests": [{"anything-but": ["rugby", "tennis"]}]

이 속성은 다음 메시지 속성 중 하나와 일치합니다.

"customer_interests": {"Type": "String", "Value": "baseball"}
"customer_interests": {"Type": "String", "Value": "football"}

이 속성은 다음 메시지 본문 중 하나와도 일치합니다.

{ "customer_interests": "baseball" }
{ "customer_interests": "football" }

또한 다음 메시지 속성과 일치합니다(rugby 또는 tennis아닌 값이 포함되어 있기 때문).

"customer_interests": {"Type": "String.Array", "Value": "[\"rugby\", \"baseball\"]"}

또한 다음 메시지 본문과도 일치합니다(rugby 또는 tennis가 아닌 값이 포함되어 있기 때문).

{ "customer_interests": ["rugby", "baseball"] }

그러나 다음 메시지 속성과는 일치하지 않습니다.

"customer_interests": {"Type": "String", "Value": "rugby"}

다음 메시지 본문과도 일치하지 않습니다.

{ "customer_interests": ["rugby"] }

anything-but 연산자가 있는 접두사 사용

문자열 일치의 경우 anything-but 연산자와 함께 접두사를 사용할 수도 있습니다. 예를 들어 다음 정책 속성은 order- 접두사를 거부합니다.

"event":[{"anything-but": {"prefix": "order-"}}]

이 속성은 다음 속성 중 하나와 일치합니다.

"event": {"Type": "String", "Value": "data-entry"}
"event": {"Type": "String", "Value": "order_number"}

이 속성은 다음 메시지 본문 중 하나와도 일치합니다.

{ "event": "data-entry" }
{ "event": "order_number" }

그러나 다음 메시지 속성과는 일치하지 않습니다.

"event": {"Type": "String", "Value": "order-cancelled"}

다음 메시지 본문과도 일치하지 않습니다.

{ "event": "order-cancelled" }

E 매칭 quals-ignore-case

정책 속성이 키워드 equals-ignore-case를 포함하고 있는 경우, 모든 메시지 속성 또는 본문 속성 값에 대해 대소문자를 구분하지 않는 일치 연산을 수행합니다.

다음 정책 속성을 살펴보겠습니다.

"customer_interests": [{"equals-ignore-case": "tennis"}]

이 속성은 다음 메시지 속성 중 하나와 일치합니다.

"customer_interests": {"Type": "String", "Value": "TENNIS"}
"customer_interests": {"Type": "String", "Value": "Tennis"}

이 속성은 다음 메시지 본문 중 하나와도 일치합니다.

{ "customer_interests": "TENNIS" }
{ "customer_interests": "teNnis" {

IP 주소 일치

cidr 연산자를 사용하여 수신 메시지가 특정 IP 주소 또는 서브넷에서 발생하는지 확인할 수 있습니다.

다음 정책 속성을 살펴보겠습니다.

"source_ip":[{"cidr": "10.0.0.0/24"}]

이 속성은 다음 메시지 속성 중 하나와 일치합니다.

"source_ip": {"Type": "String", "Value": "10.0.0.0"}
"source_ip": {"Type": "String", "Value": "10.0.0.255"}

이 속성은 다음 메시지 본문 중 하나와도 일치합니다.

{ "source_ip": "10.0.0.0" }
{ "source_ip": "10.0.0.255" }

그러나 다음 메시지 속성과는 일치하지 않습니다.

"source_ip": {"Type": "String", "Value": "10.1.1.0"}

다음 메시지 본문과도 일치하지 않습니다.

{ "source_ip": "10.1.1.0" }

접두사 일치

정책 속성이 키워드 prefix를 포함하고 있는 경우, 이 값은 메시지 속성 또는 지정된 문자로 시작하는 모든 메시지 속성 값과 일치합니다.

다음 정책 속성을 살펴보겠습니다.

"customer_interests": [{"prefix": "bas"}]

이 속성은 다음 메시지 속성 중 하나와 일치합니다.

"customer_interests": {"Type": "String", "Value": "baseball"}
"customer_interests": {"Type": "String", "Value": "basketball"}

이 속성은 다음 메시지 본문 중 하나와도 일치합니다.

{ "customer_interests": "baseball" }
{ "customer_interests": "basketball" }

그러나 다음 메시지 속성과는 일치하지 않습니다.

"customer_interests": {"Type": "String", "Value": "rugby"}

다음 메시지 본문과도 일치하지 않습니다.

{ "customer_interests": "rugby" }

접미사 일치

정책 속성이 키워드 suffix를 포함하고 있는 경우, 이 값은 메시지 속성 또는 지정된 문자로 끝나는 모든 메시지 속성 값과 일치합니다.

다음 정책 속성을 살펴보겠습니다.

"customer_interests": [{"suffix": "ball"}]

이 속성은 다음 메시지 속성 중 하나와 일치합니다.

"customer_interests": {"Type": "String", "Value": "baseball"}
"customer_interests": {"Type": "String", "Value": "basketball"}

이 속성은 다음 메시지 본문 중 하나와도 일치합니다.

{ "customer_interests": "baseball" }
{ "customer_interests": "basketball" }

그러나 다음 메시지 속성과는 일치하지 않습니다.

"customer_interests": {"Type": "String", "Value": "rugby"}

다음 메시지 본문과도 일치하지 않습니다.

{ "customer_interests": "rugby" }