public class PutResourcePolicyRequest extends AmazonWebServiceRequest implements java.io.Serializable
Creates or updates a resource policy allowing other AWS services to put log events to this account, such as Amazon Route 53. An account can have up to 10 resource policies per region.
Constructor and Description |
---|
PutResourcePolicyRequest() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getPolicyDocument()
Details of the new policy, including the identity of the principal that
is enabled to put logs to this account.
|
java.lang.String |
getPolicyName()
Name of the new policy.
|
int |
hashCode() |
void |
setPolicyDocument(java.lang.String policyDocument)
Details of the new policy, including the identity of the principal that
is enabled to put logs to this account.
|
void |
setPolicyName(java.lang.String policyName)
Name of the new policy.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
PutResourcePolicyRequest |
withPolicyDocument(java.lang.String policyDocument)
Details of the new policy, including the identity of the principal that
is enabled to put logs to this account.
|
PutResourcePolicyRequest |
withPolicyName(java.lang.String policyName)
Name of the new policy.
|
clone, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public java.lang.String getPolicyName()
Name of the new policy. This parameter is required.
Name of the new policy. This parameter is required.
public void setPolicyName(java.lang.String policyName)
Name of the new policy. This parameter is required.
policyName
- Name of the new policy. This parameter is required.
public PutResourcePolicyRequest withPolicyName(java.lang.String policyName)
Name of the new policy. This parameter is required.
Returns a reference to this object so that method calls can be chained together.
policyName
- Name of the new policy. This parameter is required.
public java.lang.String getPolicyDocument()
Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string.
The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace "logArn" with the ARN of your CloudWatch Logs resource, such as a log group or log stream.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": [ "route53.amazonaws.com" ] }, "Action":"logs:PutLogEvents", "Resource": "logArn" } ] }
Constraints:
Length: 1 - 5120
Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string.
The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace "logArn" with the ARN of your CloudWatch Logs resource, such as a log group or log stream.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": [ "route53.amazonaws.com" ] }, "Action":"logs:PutLogEvents", "Resource": "logArn" } ] }
public void setPolicyDocument(java.lang.String policyDocument)
Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string.
The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace "logArn" with the ARN of your CloudWatch Logs resource, such as a log group or log stream.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": [ "route53.amazonaws.com" ] }, "Action":"logs:PutLogEvents", "Resource": "logArn" } ] }
Constraints:
Length: 1 - 5120
policyDocument
- Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string.
The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace "logArn" with the ARN of your CloudWatch Logs resource, such as a log group or log stream.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": [ "route53.amazonaws.com" ] }, "Action":"logs:PutLogEvents", "Resource": "logArn" } ] }
public PutResourcePolicyRequest withPolicyDocument(java.lang.String policyDocument)
Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string.
The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace "logArn" with the ARN of your CloudWatch Logs resource, such as a log group or log stream.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": [ "route53.amazonaws.com" ] }, "Action":"logs:PutLogEvents", "Resource": "logArn" } ] }
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 5120
policyDocument
- Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string.
The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace "logArn" with the ARN of your CloudWatch Logs resource, such as a log group or log stream.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": [ "route53.amazonaws.com" ] }, "Action":"logs:PutLogEvents", "Resource": "logArn" } ] }
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.