Policy
Provides a resource to manage an AWS Organizations policy.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.Organizations.Policy("example", new Aws.Organizations.PolicyArgs
{
Content = @"{
""Version"": ""2012-10-17"",
""Statement"": {
""Effect"": ""Allow"",
""Action"": ""*"",
""Resource"": ""*""
}
}
",
});
}
}
package main
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/organizations"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := organizations.NewPolicy(ctx, "example", &organizations.PolicyArgs{
Content: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v", "{\n", " \"Version\": \"2012-10-17\",\n", " \"Statement\": {\n", " \"Effect\": \"Allow\",\n", " \"Action\": \"*\",\n", " \"Resource\": \"*\"\n", " }\n", "}\n", "\n")),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
example = aws.organizations.Policy("example", content="""{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": "*",
"Resource": "*"
}
}
""")import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.organizations.Policy("example", {
content: `{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": "*",
"Resource": "*"
}
}
`,
});Create a Policy Resource
new Policy(name: string, args: PolicyArgs, opts?: CustomResourceOptions);def Policy(resource_name, opts=None, content=None, description=None, name=None, type=None, __props__=None);func NewPolicy(ctx *Context, name string, args PolicyArgs, opts ...ResourceOption) (*Policy, error)public Policy(string name, PolicyArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Policy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Policy resource accepts the following input properties:
- Content string
The policy content to add to the new policy. For example, if you create a service control policy (SCP), this string must be JSON text that specifies the permissions that admins in attached accounts can delegate to their users, groups, and roles. For more information about the SCP syntax, see the Service Control Policy Syntax documentation and for more information on the Tag Policy syntax, see the Tag Policy Syntax documentation.
- Description string
A description to assign to the policy.
- Name string
The friendly name to assign to the policy.
- Type string
The type of policy to create. Currently, the only valid values are
SERVICE_CONTROL_POLICY(SCP) andTAG_POLICY. Defaults toSERVICE_CONTROL_POLICY.
- Content string
The policy content to add to the new policy. For example, if you create a service control policy (SCP), this string must be JSON text that specifies the permissions that admins in attached accounts can delegate to their users, groups, and roles. For more information about the SCP syntax, see the Service Control Policy Syntax documentation and for more information on the Tag Policy syntax, see the Tag Policy Syntax documentation.
- Description string
A description to assign to the policy.
- Name string
The friendly name to assign to the policy.
- Type string
The type of policy to create. Currently, the only valid values are
SERVICE_CONTROL_POLICY(SCP) andTAG_POLICY. Defaults toSERVICE_CONTROL_POLICY.
- content string
The policy content to add to the new policy. For example, if you create a service control policy (SCP), this string must be JSON text that specifies the permissions that admins in attached accounts can delegate to their users, groups, and roles. For more information about the SCP syntax, see the Service Control Policy Syntax documentation and for more information on the Tag Policy syntax, see the Tag Policy Syntax documentation.
- description string
A description to assign to the policy.
- name string
The friendly name to assign to the policy.
- type string
The type of policy to create. Currently, the only valid values are
SERVICE_CONTROL_POLICY(SCP) andTAG_POLICY. Defaults toSERVICE_CONTROL_POLICY.
- content str
The policy content to add to the new policy. For example, if you create a service control policy (SCP), this string must be JSON text that specifies the permissions that admins in attached accounts can delegate to their users, groups, and roles. For more information about the SCP syntax, see the Service Control Policy Syntax documentation and for more information on the Tag Policy syntax, see the Tag Policy Syntax documentation.
- description str
A description to assign to the policy.
- name str
The friendly name to assign to the policy.
- type str
The type of policy to create. Currently, the only valid values are
SERVICE_CONTROL_POLICY(SCP) andTAG_POLICY. Defaults toSERVICE_CONTROL_POLICY.
Outputs
All input properties are implicitly available as output properties. Additionally, the Policy resource produces the following output properties:
Look up an Existing Policy Resource
Get an existing Policy 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?: PolicyState, opts?: CustomResourceOptions): Policystatic get(resource_name, id, opts=None, arn=None, content=None, description=None, name=None, type=None, __props__=None);func GetPolicy(ctx *Context, name string, id IDInput, state *PolicyState, opts ...ResourceOption) (*Policy, error)public static Policy Get(string name, Input<string> id, PolicyState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Arn string
Amazon Resource Name (ARN) of the policy.
- Content string
The policy content to add to the new policy. For example, if you create a service control policy (SCP), this string must be JSON text that specifies the permissions that admins in attached accounts can delegate to their users, groups, and roles. For more information about the SCP syntax, see the Service Control Policy Syntax documentation and for more information on the Tag Policy syntax, see the Tag Policy Syntax documentation.
- Description string
A description to assign to the policy.
- Name string
The friendly name to assign to the policy.
- Type string
The type of policy to create. Currently, the only valid values are
SERVICE_CONTROL_POLICY(SCP) andTAG_POLICY. Defaults toSERVICE_CONTROL_POLICY.
- Arn string
Amazon Resource Name (ARN) of the policy.
- Content string
The policy content to add to the new policy. For example, if you create a service control policy (SCP), this string must be JSON text that specifies the permissions that admins in attached accounts can delegate to their users, groups, and roles. For more information about the SCP syntax, see the Service Control Policy Syntax documentation and for more information on the Tag Policy syntax, see the Tag Policy Syntax documentation.
- Description string
A description to assign to the policy.
- Name string
The friendly name to assign to the policy.
- Type string
The type of policy to create. Currently, the only valid values are
SERVICE_CONTROL_POLICY(SCP) andTAG_POLICY. Defaults toSERVICE_CONTROL_POLICY.
- arn string
Amazon Resource Name (ARN) of the policy.
- content string
The policy content to add to the new policy. For example, if you create a service control policy (SCP), this string must be JSON text that specifies the permissions that admins in attached accounts can delegate to their users, groups, and roles. For more information about the SCP syntax, see the Service Control Policy Syntax documentation and for more information on the Tag Policy syntax, see the Tag Policy Syntax documentation.
- description string
A description to assign to the policy.
- name string
The friendly name to assign to the policy.
- type string
The type of policy to create. Currently, the only valid values are
SERVICE_CONTROL_POLICY(SCP) andTAG_POLICY. Defaults toSERVICE_CONTROL_POLICY.
- arn str
Amazon Resource Name (ARN) of the policy.
- content str
The policy content to add to the new policy. For example, if you create a service control policy (SCP), this string must be JSON text that specifies the permissions that admins in attached accounts can delegate to their users, groups, and roles. For more information about the SCP syntax, see the Service Control Policy Syntax documentation and for more information on the Tag Policy syntax, see the Tag Policy Syntax documentation.
- description str
A description to assign to the policy.
- name str
The friendly name to assign to the policy.
- type str
The type of policy to create. Currently, the only valid values are
SERVICE_CONTROL_POLICY(SCP) andTAG_POLICY. Defaults toSERVICE_CONTROL_POLICY.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.