public class SNSConditionFactory
extends java.lang.Object
newEndpointCondition(String)
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ENDPOINT_CONDITION_KEY
Condition key for The URL, e-mail address, or ARN from a Subscribe
request or a previously confirmed subscription.
|
static java.lang.String |
PROTOCOL_CONDITION_KEY
Condition key for the protocol value from a Subscribe request or a
previously confirmed subscription.
|
Modifier and Type | Method and Description |
---|---|
static Condition |
newEndpointCondition(java.lang.String endpointPattern)
Constructs a new access policy condition that compares the requested
endpoint used to subscribe to an Amazon SNS topic with the specified
endpoint pattern.
|
static Condition |
newProtocolCondition(java.lang.String protocol)
Constructs a new AWS access control policy condition that allows an
access control statement to restrict subscriptions to an Amazon SNS topic
based on the protocol being used for the subscription.
|
public static final java.lang.String ENDPOINT_CONDITION_KEY
This condition key may only be used with StringCondition
objects.
public static final java.lang.String PROTOCOL_CONDITION_KEY
This condition key may only be used with StringCondition
objects.
public static Condition newEndpointCondition(java.lang.String endpointPattern)
For example, this condition can restrict subscriptions to a topic to email addresses in a certain domain ("*@my-company.com").
Policy policy = new Policy("MyTopicPolicy"); policy.withStatements(new Statement("RestrictSubscriptions", Effect.Allow) .withPrincipals(new Principal("*")).withActions(SNSActions.Subscribe) .withResources(new Resource(myTopicArn)) .withConditions(SNSConditionFactory.newEndpointCondition("*@my-company.com")));
endpointPattern
- The endpoint pattern against which to compare the
requested endpoint for an Amazon SNS topic subscription.public static Condition newProtocolCondition(java.lang.String protocol)
protocol
- The protocol against which to compare the requested
protocol for an Amazon SNS topic subscription.Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.