aws.cloudwatch.LogResourcePolicy
Explore with Pulumi AI
Provides a resource to manage a CloudWatch log resource policy.
Example Usage
Elasticsearch Log Publishing
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const elasticsearch_log_publishing_policy = aws.iam.getPolicyDocument({
statements: [{
actions: [
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:PutLogEventsBatch",
],
resources: ["arn:aws:logs:*"],
principals: [{
identifiers: ["es.amazonaws.com"],
type: "Service",
}],
}],
});
const elasticsearch_log_publishing_policyLogResourcePolicy = new aws.cloudwatch.LogResourcePolicy("elasticsearch-log-publishing-policy", {
policyDocument: elasticsearch_log_publishing_policy.then(elasticsearch_log_publishing_policy => elasticsearch_log_publishing_policy.json),
policyName: "elasticsearch-log-publishing-policy",
});
import pulumi
import pulumi_aws as aws
elasticsearch_log_publishing_policy = aws.iam.get_policy_document(statements=[{
"actions": [
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:PutLogEventsBatch",
],
"resources": ["arn:aws:logs:*"],
"principals": [{
"identifiers": ["es.amazonaws.com"],
"type": "Service",
}],
}])
elasticsearch_log_publishing_policy_log_resource_policy = aws.cloudwatch.LogResourcePolicy("elasticsearch-log-publishing-policy",
policy_document=elasticsearch_log_publishing_policy.json,
policy_name="elasticsearch-log-publishing-policy")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cloudwatch"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
elasticsearch_log_publishing_policy, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
Statements: []iam.GetPolicyDocumentStatement{
{
Actions: []string{
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:PutLogEventsBatch",
},
Resources: []string{
"arn:aws:logs:*",
},
Principals: []iam.GetPolicyDocumentStatementPrincipal{
{
Identifiers: []string{
"es.amazonaws.com",
},
Type: "Service",
},
},
},
},
}, nil)
if err != nil {
return err
}
_, err = cloudwatch.NewLogResourcePolicy(ctx, "elasticsearch-log-publishing-policy", &cloudwatch.LogResourcePolicyArgs{
PolicyDocument: pulumi.String(elasticsearch_log_publishing_policy.Json),
PolicyName: pulumi.String("elasticsearch-log-publishing-policy"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var elasticsearch_log_publishing_policy = Aws.Iam.GetPolicyDocument.Invoke(new()
{
Statements = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
{
Actions = new[]
{
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:PutLogEventsBatch",
},
Resources = new[]
{
"arn:aws:logs:*",
},
Principals = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
{
Identifiers = new[]
{
"es.amazonaws.com",
},
Type = "Service",
},
},
},
},
});
var elasticsearch_log_publishing_policyLogResourcePolicy = new Aws.CloudWatch.LogResourcePolicy("elasticsearch-log-publishing-policy", new()
{
PolicyDocument = elasticsearch_log_publishing_policy.Apply(elasticsearch_log_publishing_policy => elasticsearch_log_publishing_policy.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json)),
PolicyName = "elasticsearch-log-publishing-policy",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.cloudwatch.LogResourcePolicy;
import com.pulumi.aws.cloudwatch.LogResourcePolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var elasticsearch-log-publishing-policy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.actions(
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:PutLogEventsBatch")
.resources("arn:aws:logs:*")
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.identifiers("es.amazonaws.com")
.type("Service")
.build())
.build())
.build());
var elasticsearch_log_publishing_policyLogResourcePolicy = new LogResourcePolicy("elasticsearch-log-publishing-policyLogResourcePolicy", LogResourcePolicyArgs.builder()
.policyDocument(elasticsearch_log_publishing_policy.json())
.policyName("elasticsearch-log-publishing-policy")
.build());
}
}
resources:
elasticsearch-log-publishing-policyLogResourcePolicy:
type: aws:cloudwatch:LogResourcePolicy
name: elasticsearch-log-publishing-policy
properties:
policyDocument: ${["elasticsearch-log-publishing-policy"].json}
policyName: elasticsearch-log-publishing-policy
variables:
elasticsearch-log-publishing-policy:
fn::invoke:
function: aws:iam:getPolicyDocument
arguments:
statements:
- actions:
- logs:CreateLogStream
- logs:PutLogEvents
- logs:PutLogEventsBatch
resources:
- arn:aws:logs:*
principals:
- identifiers:
- es.amazonaws.com
type: Service
Route53 Query Logging
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const route53_query_logging_policy = aws.iam.getPolicyDocument({
statements: [{
actions: [
"logs:CreateLogStream",
"logs:PutLogEvents",
],
resources: ["arn:aws:logs:*:*:log-group:/aws/route53/*"],
principals: [{
identifiers: ["route53.amazonaws.com"],
type: "Service",
}],
}],
});
const route53_query_logging_policyLogResourcePolicy = new aws.cloudwatch.LogResourcePolicy("route53-query-logging-policy", {
policyDocument: route53_query_logging_policy.then(route53_query_logging_policy => route53_query_logging_policy.json),
policyName: "route53-query-logging-policy",
});
import pulumi
import pulumi_aws as aws
route53_query_logging_policy = aws.iam.get_policy_document(statements=[{
"actions": [
"logs:CreateLogStream",
"logs:PutLogEvents",
],
"resources": ["arn:aws:logs:*:*:log-group:/aws/route53/*"],
"principals": [{
"identifiers": ["route53.amazonaws.com"],
"type": "Service",
}],
}])
route53_query_logging_policy_log_resource_policy = aws.cloudwatch.LogResourcePolicy("route53-query-logging-policy",
policy_document=route53_query_logging_policy.json,
policy_name="route53-query-logging-policy")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cloudwatch"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
route53_query_logging_policy, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
Statements: []iam.GetPolicyDocumentStatement{
{
Actions: []string{
"logs:CreateLogStream",
"logs:PutLogEvents",
},
Resources: []string{
"arn:aws:logs:*:*:log-group:/aws/route53/*",
},
Principals: []iam.GetPolicyDocumentStatementPrincipal{
{
Identifiers: []string{
"route53.amazonaws.com",
},
Type: "Service",
},
},
},
},
}, nil)
if err != nil {
return err
}
_, err = cloudwatch.NewLogResourcePolicy(ctx, "route53-query-logging-policy", &cloudwatch.LogResourcePolicyArgs{
PolicyDocument: pulumi.String(route53_query_logging_policy.Json),
PolicyName: pulumi.String("route53-query-logging-policy"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var route53_query_logging_policy = Aws.Iam.GetPolicyDocument.Invoke(new()
{
Statements = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
{
Actions = new[]
{
"logs:CreateLogStream",
"logs:PutLogEvents",
},
Resources = new[]
{
"arn:aws:logs:*:*:log-group:/aws/route53/*",
},
Principals = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
{
Identifiers = new[]
{
"route53.amazonaws.com",
},
Type = "Service",
},
},
},
},
});
var route53_query_logging_policyLogResourcePolicy = new Aws.CloudWatch.LogResourcePolicy("route53-query-logging-policy", new()
{
PolicyDocument = route53_query_logging_policy.Apply(route53_query_logging_policy => route53_query_logging_policy.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json)),
PolicyName = "route53-query-logging-policy",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.cloudwatch.LogResourcePolicy;
import com.pulumi.aws.cloudwatch.LogResourcePolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var route53-query-logging-policy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.actions(
"logs:CreateLogStream",
"logs:PutLogEvents")
.resources("arn:aws:logs:*:*:log-group:/aws/route53/*")
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.identifiers("route53.amazonaws.com")
.type("Service")
.build())
.build())
.build());
var route53_query_logging_policyLogResourcePolicy = new LogResourcePolicy("route53-query-logging-policyLogResourcePolicy", LogResourcePolicyArgs.builder()
.policyDocument(route53_query_logging_policy.json())
.policyName("route53-query-logging-policy")
.build());
}
}
resources:
route53-query-logging-policyLogResourcePolicy:
type: aws:cloudwatch:LogResourcePolicy
name: route53-query-logging-policy
properties:
policyDocument: ${["route53-query-logging-policy"].json}
policyName: route53-query-logging-policy
variables:
route53-query-logging-policy:
fn::invoke:
function: aws:iam:getPolicyDocument
arguments:
statements:
- actions:
- logs:CreateLogStream
- logs:PutLogEvents
resources:
- arn:aws:logs:*:*:log-group:/aws/route53/*
principals:
- identifiers:
- route53.amazonaws.com
type: Service
Create LogResourcePolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new LogResourcePolicy(name: string, args: LogResourcePolicyArgs, opts?: CustomResourceOptions);
@overload
def LogResourcePolicy(resource_name: str,
args: LogResourcePolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def LogResourcePolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
policy_document: Optional[Union[str, PolicyDocumentArgs]] = None,
policy_name: Optional[str] = None,
region: Optional[str] = None)
func NewLogResourcePolicy(ctx *Context, name string, args LogResourcePolicyArgs, opts ...ResourceOption) (*LogResourcePolicy, error)
public LogResourcePolicy(string name, LogResourcePolicyArgs args, CustomResourceOptions? opts = null)
public LogResourcePolicy(String name, LogResourcePolicyArgs args)
public LogResourcePolicy(String name, LogResourcePolicyArgs args, CustomResourceOptions options)
type: aws:cloudwatch:LogResourcePolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args LogResourcePolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args LogResourcePolicyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args LogResourcePolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LogResourcePolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LogResourcePolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var logResourcePolicyResource = new Aws.CloudWatch.LogResourcePolicy("logResourcePolicyResource", new()
{
PolicyDocument = "string",
PolicyName = "string",
Region = "string",
});
example, err := cloudwatch.NewLogResourcePolicy(ctx, "logResourcePolicyResource", &cloudwatch.LogResourcePolicyArgs{
PolicyDocument: pulumi.Any("string"),
PolicyName: pulumi.String("string"),
Region: pulumi.String("string"),
})
var logResourcePolicyResource = new LogResourcePolicy("logResourcePolicyResource", LogResourcePolicyArgs.builder()
.policyDocument("string")
.policyName("string")
.region("string")
.build());
log_resource_policy_resource = aws.cloudwatch.LogResourcePolicy("logResourcePolicyResource",
policy_document="string",
policy_name="string",
region="string")
const logResourcePolicyResource = new aws.cloudwatch.LogResourcePolicy("logResourcePolicyResource", {
policyDocument: "string",
policyName: "string",
region: "string",
});
type: aws:cloudwatch:LogResourcePolicy
properties:
policyDocument: string
policyName: string
region: string
LogResourcePolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The LogResourcePolicy resource accepts the following input properties:
- Policy
Document string | PolicyDocument - Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
- Policy
Name string - Name of the resource policy.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Policy
Document string | PolicyDocument Args - Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
- Policy
Name string - Name of the resource policy.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- policy
Document String | PolicyDocument - Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
- policy
Name String - Name of the resource policy.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- policy
Document string | PolicyDocument - Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
- policy
Name string - Name of the resource policy.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- policy_
document str | PolicyDocument Args - Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
- policy_
name str - Name of the resource policy.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- policy
Document String | Property Map - Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
- policy
Name String - Name of the resource policy.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
Outputs
All input properties are implicitly available as output properties. Additionally, the LogResourcePolicy resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing LogResourcePolicy Resource
Get an existing LogResourcePolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: LogResourcePolicyState, opts?: CustomResourceOptions): LogResourcePolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
policy_document: Optional[Union[str, PolicyDocumentArgs]] = None,
policy_name: Optional[str] = None,
region: Optional[str] = None) -> LogResourcePolicy
func GetLogResourcePolicy(ctx *Context, name string, id IDInput, state *LogResourcePolicyState, opts ...ResourceOption) (*LogResourcePolicy, error)
public static LogResourcePolicy Get(string name, Input<string> id, LogResourcePolicyState? state, CustomResourceOptions? opts = null)
public static LogResourcePolicy get(String name, Output<String> id, LogResourcePolicyState state, CustomResourceOptions options)
resources: _: type: aws:cloudwatch:LogResourcePolicy get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Policy
Document string | PolicyDocument - Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
- Policy
Name string - Name of the resource policy.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Policy
Document string | PolicyDocument Args - Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
- Policy
Name string - Name of the resource policy.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- policy
Document String | PolicyDocument - Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
- policy
Name String - Name of the resource policy.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- policy
Document string | PolicyDocument - Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
- policy
Name string - Name of the resource policy.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- policy_
document str | PolicyDocument Args - Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
- policy_
name str - Name of the resource policy.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- policy
Document String | Property Map - Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
- policy
Name String - Name of the resource policy.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
Supporting Types
AWSPrincipal, AWSPrincipalArgs
- AWS string | List<string>
- AWS account identifier or ARN.
- AWS string | []string
- AWS account identifier or ARN.
- AWS String | List<String>
- AWS account identifier or ARN.
- AWS string | string[]
- AWS account identifier or ARN.
- aws str | Sequence[str]
- AWS account identifier or ARN.
- AWS String | List<String>
- AWS account identifier or ARN.
FederatedPrincipal, FederatedPrincipalArgs
- Federated string | List<string>
- The federated principal identifier.
- Federated string | []string
- The federated principal identifier.
- Federated String | List<String>
- The federated principal identifier.
- Federated string | string[]
- The federated principal identifier.
- federated str | Sequence[str]
- The federated principal identifier.
- Federated String | List<String>
- The federated principal identifier.
PolicyDocument, PolicyDocumentArgs
PolicyDocumentVersion, PolicyDocumentVersionArgs
- Policy
Document Version_2012_10_17 - 2012-10-17
- Policy
Document Version_2008_10_17 - 2008-10-17
- Policy
Document Version_2012_10_17 - 2012-10-17
- Policy
Document Version_2008_10_17 - 2008-10-17
- _20121017
- 2012-10-17
- _20081017
- 2008-10-17
- Policy
Document Version_2012_10_17 - 2012-10-17
- Policy
Document Version_2008_10_17 - 2008-10-17
- POLICY_DOCUMENT_VERSION_2012_10_17
- 2012-10-17
- POLICY_DOCUMENT_VERSION_2008_10_17
- 2008-10-17
- "2012-10-17"
- 2012-10-17
- "2008-10-17"
- 2008-10-17
PolicyStatement, PolicyStatementArgs
- Effect
Pulumi.
Aws. Iam. Policy Statement Effect - Indicate whether the policy allows or denies access.
- Action string | List<string>
- Include a list of actions that the policy allows or denies. Required (either Action or NotAction)
- Condition Dictionary<string, object>
- Specify the circumstances under which the policy grants permission.
- Not
Action string | List<string> - Include a list of actions that are not covered by this policy. Required (either Action or NotAction)
- Not
Principal string | Pulumi.Aws. | Pulumi.Iam. Inputs. AWSPrincipal Aws. | Pulumi.Iam. Inputs. Service Principal Aws. Iam. Inputs. Federated Principal - Indicate the account, user, role, or federated user to which this policy does not apply.
- Not
Resource string | List<string> - A list of resources that are specifically excluded by this policy.
- Principal
string | Pulumi.
Aws. | Pulumi.Iam. Inputs. AWSPrincipal Aws. | Pulumi.Iam. Inputs. Service Principal Aws. Iam. Inputs. Federated Principal - Indicate the account, user, role, or federated user to which you would like to allow or deny access. If you are creating a policy to attach to a user or role, you cannot include this element. The principal is implied as that user or role.
- Resource string | List<string>
- A list of resources to which the actions apply.
- Sid string
- An optional statement ID to differentiate between your statements.
- Effect
Policy
Statement Effect - Indicate whether the policy allows or denies access.
- Action string | []string
- Include a list of actions that the policy allows or denies. Required (either Action or NotAction)
- Condition map[string]interface{}
- Specify the circumstances under which the policy grants permission.
- Not
Action string | []string - Include a list of actions that are not covered by this policy. Required (either Action or NotAction)
- Not
Principal string | AWSPrincipal | ServicePrincipal | FederatedPrincipal - Indicate the account, user, role, or federated user to which this policy does not apply.
- Not
Resource string | []string - A list of resources that are specifically excluded by this policy.
- Principal
string | AWSPrincipal | Service
Principal | FederatedPrincipal - Indicate the account, user, role, or federated user to which you would like to allow or deny access. If you are creating a policy to attach to a user or role, you cannot include this element. The principal is implied as that user or role.
- Resource string | []string
- A list of resources to which the actions apply.
- Sid string
- An optional statement ID to differentiate between your statements.
- Effect
Policy
Statement Effect - Indicate whether the policy allows or denies access.
- Action String | List<String>
- Include a list of actions that the policy allows or denies. Required (either Action or NotAction)
- Condition Map<String,Object>
- Specify the circumstances under which the policy grants permission.
- Not
Action String | List<String> - Include a list of actions that are not covered by this policy. Required (either Action or NotAction)
- Not
Principal String | AWSPrincipal | ServicePrincipal | FederatedPrincipal - Indicate the account, user, role, or federated user to which this policy does not apply.
- Not
Resource String | List<String> - A list of resources that are specifically excluded by this policy.
- Principal
String | AWSPrincipal | Service
Principal | FederatedPrincipal - Indicate the account, user, role, or federated user to which you would like to allow or deny access. If you are creating a policy to attach to a user or role, you cannot include this element. The principal is implied as that user or role.
- Resource String | List<String>
- A list of resources to which the actions apply.
- Sid String
- An optional statement ID to differentiate between your statements.
- Effect
iam.
Policy Statement Effect - Indicate whether the policy allows or denies access.
- Action string | string[]
- Include a list of actions that the policy allows or denies. Required (either Action or NotAction)
- Condition {[key: string]: any}
- Specify the circumstances under which the policy grants permission.
- Not
Action string | string[] - Include a list of actions that are not covered by this policy. Required (either Action or NotAction)
- Not
Principal string | iam.AWSPrincipal | iam.Service | iam.Principal Federated Principal - Indicate the account, user, role, or federated user to which this policy does not apply.
- Not
Resource string | string[] - A list of resources that are specifically excluded by this policy.
- Principal
string | iam.
AWSPrincipal | iam.Service | iam.Principal Federated Principal - Indicate the account, user, role, or federated user to which you would like to allow or deny access. If you are creating a policy to attach to a user or role, you cannot include this element. The principal is implied as that user or role.
- Resource string | string[]
- A list of resources to which the actions apply.
- Sid string
- An optional statement ID to differentiate between your statements.
- effect
iam.
Policy Statement Effect - Indicate whether the policy allows or denies access.
- action str | Sequence[str]
- Include a list of actions that the policy allows or denies. Required (either Action or NotAction)
- condition Mapping[str, Any]
- Specify the circumstances under which the policy grants permission.
- not_
action str | Sequence[str] - Include a list of actions that are not covered by this policy. Required (either Action or NotAction)
- not_
principal str | iam.AWSPrincipal | iam.Service | iam.Principal Federated Principal - Indicate the account, user, role, or federated user to which this policy does not apply.
- not_
resource str | Sequence[str] - A list of resources that are specifically excluded by this policy.
- principal
str | iam.
AWSPrincipal | iam.Service | iam.Principal Federated Principal - Indicate the account, user, role, or federated user to which you would like to allow or deny access. If you are creating a policy to attach to a user or role, you cannot include this element. The principal is implied as that user or role.
- resource str | Sequence[str]
- A list of resources to which the actions apply.
- sid str
- An optional statement ID to differentiate between your statements.
- Effect "Allow" | "Deny"
- Indicate whether the policy allows or denies access.
- Action String | List<String>
- Include a list of actions that the policy allows or denies. Required (either Action or NotAction)
- Condition Map<Any>
- Specify the circumstances under which the policy grants permission.
- Not
Action String | List<String> - Include a list of actions that are not covered by this policy. Required (either Action or NotAction)
- Not
Principal String | Property Map | Property Map | Property Map - Indicate the account, user, role, or federated user to which this policy does not apply.
- Not
Resource String | List<String> - A list of resources that are specifically excluded by this policy.
- Principal String | Property Map | Property Map | Property Map
- Indicate the account, user, role, or federated user to which you would like to allow or deny access. If you are creating a policy to attach to a user or role, you cannot include this element. The principal is implied as that user or role.
- Resource String | List<String>
- A list of resources to which the actions apply.
- Sid String
- An optional statement ID to differentiate between your statements.
PolicyStatementEffect, PolicyStatementEffectArgs
- ALLOW
- Allow
- DENY
- Deny
- Policy
Statement Effect ALLOW - Allow
- Policy
Statement Effect DENY - Deny
- ALLOW
- Allow
- DENY
- Deny
- ALLOW
- Allow
- DENY
- Deny
- ALLOW
- Allow
- DENY
- Deny
- "Allow"
- Allow
- "Deny"
- Deny
ServicePrincipal, ServicePrincipalArgs
- Service string | List<string>
- The service principal identifier.
- Service string | []string
- The service principal identifier.
- Service String | List<String>
- The service principal identifier.
- Service string | string[]
- The service principal identifier.
- service str | Sequence[str]
- The service principal identifier.
- Service String | List<String>
- The service principal identifier.
Import
Using pulumi import
, import CloudWatch log resource policies using the policy name. For example:
$ pulumi import aws:cloudwatch/logResourcePolicy:LogResourcePolicy MyPolicy MyPolicy
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.