public class SNSConditionFactory extends Object
newEndpointCondition(String)
.Modifier and Type | Field and Description |
---|---|
static String |
ENDPOINT_CONDITION_KEY
Condition key for The URL, e-mail address, or ARN from a Subscribe
request or a previously confirmed subscription.
|
static 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(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(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 String ENDPOINT_CONDITION_KEY
This condition key may only be used with StringCondition
objects.
public static final String PROTOCOL_CONDITION_KEY
This condition key may only be used with StringCondition
objects.
public static Condition newEndpointCondition(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(String protocol)
protocol
- The protocol against which to compare the requested protocol
for an Amazon SNS topic subscription.Copyright © 2018. All rights reserved.