1. Packages
  2. AWS
  3. API Docs
  4. verifiedpermissions
  5. PolicyTemplate
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.verifiedpermissions.PolicyTemplate

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Resource for managing an AWS Verified Permissions Policy Template.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.verifiedpermissions.PolicyTemplate("example", {
        policyStoreId: exampleAwsVerifiedpermissionsPolicyStore.id,
        statement: "permit (principal in ?principal, action in PhotoFlash::Action::\"FullPhotoAccess\", resource == ?resource) unless { resource.IsPrivate };",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.verifiedpermissions.PolicyTemplate("example",
        policy_store_id=example_aws_verifiedpermissions_policy_store["id"],
        statement="permit (principal in ?principal, action in PhotoFlash::Action::\"FullPhotoAccess\", resource == ?resource) unless { resource.IsPrivate };")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/verifiedpermissions"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := verifiedpermissions.NewPolicyTemplate(ctx, "example", &verifiedpermissions.PolicyTemplateArgs{
    			PolicyStoreId: pulumi.Any(exampleAwsVerifiedpermissionsPolicyStore.Id),
    			Statement:     pulumi.String("permit (principal in ?principal, action in PhotoFlash::Action::\"FullPhotoAccess\", resource == ?resource) unless { resource.IsPrivate };"),
    		})
    		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 example = new Aws.VerifiedPermissions.PolicyTemplate("example", new()
        {
            PolicyStoreId = exampleAwsVerifiedpermissionsPolicyStore.Id,
            Statement = "permit (principal in ?principal, action in PhotoFlash::Action::\"FullPhotoAccess\", resource == ?resource) unless { resource.IsPrivate };",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.verifiedpermissions.PolicyTemplate;
    import com.pulumi.aws.verifiedpermissions.PolicyTemplateArgs;
    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) {
            var example = new PolicyTemplate("example", PolicyTemplateArgs.builder()
                .policyStoreId(exampleAwsVerifiedpermissionsPolicyStore.id())
                .statement("permit (principal in ?principal, action in PhotoFlash::Action::\"FullPhotoAccess\", resource == ?resource) unless { resource.IsPrivate };")
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:verifiedpermissions:PolicyTemplate
        properties:
          policyStoreId: ${exampleAwsVerifiedpermissionsPolicyStore.id}
          statement: permit (principal in ?principal, action in PhotoFlash::Action::"FullPhotoAccess", resource == ?resource) unless { resource.IsPrivate };
    

    Create PolicyTemplate Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PolicyTemplate(name: string, args: PolicyTemplateArgs, opts?: CustomResourceOptions);
    @overload
    def PolicyTemplate(resource_name: str,
                       args: PolicyTemplateArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def PolicyTemplate(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       policy_store_id: Optional[str] = None,
                       statement: Optional[str] = None,
                       description: Optional[str] = None)
    func NewPolicyTemplate(ctx *Context, name string, args PolicyTemplateArgs, opts ...ResourceOption) (*PolicyTemplate, error)
    public PolicyTemplate(string name, PolicyTemplateArgs args, CustomResourceOptions? opts = null)
    public PolicyTemplate(String name, PolicyTemplateArgs args)
    public PolicyTemplate(String name, PolicyTemplateArgs args, CustomResourceOptions options)
    
    type: aws:verifiedpermissions:PolicyTemplate
    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 PolicyTemplateArgs
    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 PolicyTemplateArgs
    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 PolicyTemplateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PolicyTemplateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PolicyTemplateArgs
    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 policyTemplateResource = new Aws.VerifiedPermissions.PolicyTemplate("policyTemplateResource", new()
    {
        PolicyStoreId = "string",
        Statement = "string",
        Description = "string",
    });
    
    example, err := verifiedpermissions.NewPolicyTemplate(ctx, "policyTemplateResource", &verifiedpermissions.PolicyTemplateArgs{
    	PolicyStoreId: pulumi.String("string"),
    	Statement:     pulumi.String("string"),
    	Description:   pulumi.String("string"),
    })
    
    var policyTemplateResource = new PolicyTemplate("policyTemplateResource", PolicyTemplateArgs.builder()
        .policyStoreId("string")
        .statement("string")
        .description("string")
        .build());
    
    policy_template_resource = aws.verifiedpermissions.PolicyTemplate("policyTemplateResource",
        policy_store_id="string",
        statement="string",
        description="string")
    
    const policyTemplateResource = new aws.verifiedpermissions.PolicyTemplate("policyTemplateResource", {
        policyStoreId: "string",
        statement: "string",
        description: "string",
    });
    
    type: aws:verifiedpermissions:PolicyTemplate
    properties:
        description: string
        policyStoreId: string
        statement: string
    

    PolicyTemplate 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 PolicyTemplate resource accepts the following input properties:

    PolicyStoreId string
    The ID of the Policy Store.
    Statement string

    Defines the content of the statement, written in Cedar policy language.

    The following arguments are optional:

    Description string
    Provides a description for the policy template.
    PolicyStoreId string
    The ID of the Policy Store.
    Statement string

    Defines the content of the statement, written in Cedar policy language.

    The following arguments are optional:

    Description string
    Provides a description for the policy template.
    policyStoreId String
    The ID of the Policy Store.
    statement String

    Defines the content of the statement, written in Cedar policy language.

    The following arguments are optional:

    description String
    Provides a description for the policy template.
    policyStoreId string
    The ID of the Policy Store.
    statement string

    Defines the content of the statement, written in Cedar policy language.

    The following arguments are optional:

    description string
    Provides a description for the policy template.
    policy_store_id str
    The ID of the Policy Store.
    statement str

    Defines the content of the statement, written in Cedar policy language.

    The following arguments are optional:

    description str
    Provides a description for the policy template.
    policyStoreId String
    The ID of the Policy Store.
    statement String

    Defines the content of the statement, written in Cedar policy language.

    The following arguments are optional:

    description String
    Provides a description for the policy template.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the PolicyTemplate resource produces the following output properties:

    CreatedDate string
    The date the Policy Store was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    PolicyTemplateId string
    The ID of the Policy Store.
    CreatedDate string
    The date the Policy Store was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    PolicyTemplateId string
    The ID of the Policy Store.
    createdDate String
    The date the Policy Store was created.
    id String
    The provider-assigned unique ID for this managed resource.
    policyTemplateId String
    The ID of the Policy Store.
    createdDate string
    The date the Policy Store was created.
    id string
    The provider-assigned unique ID for this managed resource.
    policyTemplateId string
    The ID of the Policy Store.
    created_date str
    The date the Policy Store was created.
    id str
    The provider-assigned unique ID for this managed resource.
    policy_template_id str
    The ID of the Policy Store.
    createdDate String
    The date the Policy Store was created.
    id String
    The provider-assigned unique ID for this managed resource.
    policyTemplateId String
    The ID of the Policy Store.

    Look up Existing PolicyTemplate Resource

    Get an existing PolicyTemplate 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?: PolicyTemplateState, opts?: CustomResourceOptions): PolicyTemplate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_date: Optional[str] = None,
            description: Optional[str] = None,
            policy_store_id: Optional[str] = None,
            policy_template_id: Optional[str] = None,
            statement: Optional[str] = None) -> PolicyTemplate
    func GetPolicyTemplate(ctx *Context, name string, id IDInput, state *PolicyTemplateState, opts ...ResourceOption) (*PolicyTemplate, error)
    public static PolicyTemplate Get(string name, Input<string> id, PolicyTemplateState? state, CustomResourceOptions? opts = null)
    public static PolicyTemplate get(String name, Output<String> id, PolicyTemplateState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    CreatedDate string
    The date the Policy Store was created.
    Description string
    Provides a description for the policy template.
    PolicyStoreId string
    The ID of the Policy Store.
    PolicyTemplateId string
    The ID of the Policy Store.
    Statement string

    Defines the content of the statement, written in Cedar policy language.

    The following arguments are optional:

    CreatedDate string
    The date the Policy Store was created.
    Description string
    Provides a description for the policy template.
    PolicyStoreId string
    The ID of the Policy Store.
    PolicyTemplateId string
    The ID of the Policy Store.
    Statement string

    Defines the content of the statement, written in Cedar policy language.

    The following arguments are optional:

    createdDate String
    The date the Policy Store was created.
    description String
    Provides a description for the policy template.
    policyStoreId String
    The ID of the Policy Store.
    policyTemplateId String
    The ID of the Policy Store.
    statement String

    Defines the content of the statement, written in Cedar policy language.

    The following arguments are optional:

    createdDate string
    The date the Policy Store was created.
    description string
    Provides a description for the policy template.
    policyStoreId string
    The ID of the Policy Store.
    policyTemplateId string
    The ID of the Policy Store.
    statement string

    Defines the content of the statement, written in Cedar policy language.

    The following arguments are optional:

    created_date str
    The date the Policy Store was created.
    description str
    Provides a description for the policy template.
    policy_store_id str
    The ID of the Policy Store.
    policy_template_id str
    The ID of the Policy Store.
    statement str

    Defines the content of the statement, written in Cedar policy language.

    The following arguments are optional:

    createdDate String
    The date the Policy Store was created.
    description String
    Provides a description for the policy template.
    policyStoreId String
    The ID of the Policy Store.
    policyTemplateId String
    The ID of the Policy Store.
    statement String

    Defines the content of the statement, written in Cedar policy language.

    The following arguments are optional:

    Import

    Using pulumi import, import Verified Permissions Policy Store using the policy_store_id:policy_template_id. For example:

    $ pulumi import aws:verifiedpermissions/policyTemplate:PolicyTemplate example policyStoreId:policyTemplateId
    

    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.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi