/* * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.logs.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *
* 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. *
*/ public class PutResourcePolicyRequest extends AmazonWebServiceRequest implements Serializable { /** ** Name of the new policy. This parameter is required. *
*/ private String policyName; /** ** 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
*/
private String policyDocument;
/**
*
* Name of the new policy. This parameter is required. *
* * @return* Name of the new policy. This parameter is required. *
*/ public String getPolicyName() { return policyName; } /** ** Name of the new policy. This parameter is required. *
* * @param policyName* Name of the new policy. This parameter is required. *
*/ public void setPolicyName(String policyName) { this.policyName = policyName; } /** ** Name of the new policy. This parameter is required. *
** Returns a reference to this object so that method calls can be chained * together. * * @param policyName
* Name of the new policy. This parameter is required. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutResourcePolicyRequest withPolicyName(String policyName) { this.policyName = policyName; return this; } /** ** 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
*
* @return
* 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" } ] }
*
* 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
*
* @param 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" } ] }
*
* 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
*
* @param 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" } ] }
*