public final class ConditionFactory extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CURRENT_TIME_CONDITION_KEY
Condition key for the current time.
|
static String |
SOURCE_ARN_CONDITION_KEY
Condition key for the Amazon Resource Name (ARN) of the source specified
in a request.
|
static String |
SOURCE_IP_CONDITION_KEY
Condition key for the source IP from which a request originates.
|
Modifier and Type | Method and Description |
---|---|
static Condition |
newSourceArnCondition(String arnPattern)
Constructs a new access policy condition that compares the Amazon
Resource Name (ARN) of the source of an AWS resource that is modifying
another AWS resource with the specified pattern.
|
public static final String CURRENT_TIME_CONDITION_KEY
This condition key should only be used with DateCondition
objects.
public static final String SOURCE_IP_CONDITION_KEY
This condition key should only be used with IpAddressCondition
objects.
public static final String SOURCE_ARN_CONDITION_KEY
This condition key should only be used with ArnCondition
objects.
public static Condition newSourceArnCondition(String arnPattern)
For example, the source ARN could be an Amazon SNS topic ARN that is sending messages to an Amazon SQS queue. In that case, the SNS topic ARN would be compared the ARN pattern specified here.
The endpoint pattern may optionally contain the multi-character wildcard (*) or the single-character wildcard (?). Each of the six colon-delimited components of the ARN is checked separately and each can include a wildcard.
Policy policy = new Policy("MyQueuePolicy"); policy.withStatements(new Statement("AllowSNSMessages", Effect.Allow) .withPrincipals(new Principal("*")).withActions(SQSActions.SendMessage) .withResources(new Resource(myQueueArn)) .withConditions(ConditionFactory.newSourceArnCondition(myTopicArn)));
arnPattern
- The ARN pattern against which the source ARN will be compared.
Each of the six colon-delimited components of the ARN is
checked separately and each can include a wildcard.Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.