aws.verifiedpermissions.Policy
Explore with Pulumi AI
Resource for managing an AWS Verified Permissions Policy.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.verifiedpermissions.Policy("test", {
policyStoreId: testAwsVerifiedpermissionsPolicyStore.id,
definition: {
static: {
statement: "permit (principal, action == Action::\"view\", resource in Album:: \"test_album\");",
},
},
});
import pulumi
import pulumi_aws as aws
test = aws.verifiedpermissions.Policy("test",
policy_store_id=test_aws_verifiedpermissions_policy_store["id"],
definition={
"static": {
"statement": "permit (principal, action == Action::\"view\", resource in Album:: \"test_album\");",
},
})
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.NewPolicy(ctx, "test", &verifiedpermissions.PolicyArgs{
PolicyStoreId: pulumi.Any(testAwsVerifiedpermissionsPolicyStore.Id),
Definition: &verifiedpermissions.PolicyDefinitionArgs{
Static: &verifiedpermissions.PolicyDefinitionStaticArgs{
Statement: pulumi.String("permit (principal, action == Action::\"view\", resource in Album:: \"test_album\");"),
},
},
})
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 test = new Aws.VerifiedPermissions.Policy("test", new()
{
PolicyStoreId = testAwsVerifiedpermissionsPolicyStore.Id,
Definition = new Aws.VerifiedPermissions.Inputs.PolicyDefinitionArgs
{
Static = new Aws.VerifiedPermissions.Inputs.PolicyDefinitionStaticArgs
{
Statement = "permit (principal, action == Action::\"view\", resource in Album:: \"test_album\");",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.verifiedpermissions.Policy;
import com.pulumi.aws.verifiedpermissions.PolicyArgs;
import com.pulumi.aws.verifiedpermissions.inputs.PolicyDefinitionArgs;
import com.pulumi.aws.verifiedpermissions.inputs.PolicyDefinitionStaticArgs;
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 test = new Policy("test", PolicyArgs.builder()
.policyStoreId(testAwsVerifiedpermissionsPolicyStore.id())
.definition(PolicyDefinitionArgs.builder()
.static_(PolicyDefinitionStaticArgs.builder()
.statement("permit (principal, action == Action::\"view\", resource in Album:: \"test_album\");")
.build())
.build())
.build());
}
}
resources:
test:
type: aws:verifiedpermissions:Policy
properties:
policyStoreId: ${testAwsVerifiedpermissionsPolicyStore.id}
definition:
static:
statement: 'permit (principal, action == Action::"view", resource in Album:: "test_album");'
Create Policy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Policy(name: string, args: PolicyArgs, opts?: CustomResourceOptions);
@overload
def Policy(resource_name: str,
args: PolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Policy(resource_name: str,
opts: Optional[ResourceOptions] = None,
policy_store_id: Optional[str] = None,
definition: Optional[PolicyDefinitionArgs] = None)
func NewPolicy(ctx *Context, name string, args PolicyArgs, opts ...ResourceOption) (*Policy, error)
public Policy(string name, PolicyArgs args, CustomResourceOptions? opts = null)
public Policy(String name, PolicyArgs args)
public Policy(String name, PolicyArgs args, CustomResourceOptions options)
type: aws:verifiedpermissions:Policy
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 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.
- args PolicyArgs
- 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 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.
- name String
- The unique name of the resource.
- args PolicyArgs
- 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 examplepolicyResourceResourceFromVerifiedpermissionspolicy = new Aws.VerifiedPermissions.Policy("examplepolicyResourceResourceFromVerifiedpermissionspolicy", new()
{
PolicyStoreId = "string",
Definition = new Aws.VerifiedPermissions.Inputs.PolicyDefinitionArgs
{
Static = new Aws.VerifiedPermissions.Inputs.PolicyDefinitionStaticArgs
{
Statement = "string",
Description = "string",
},
TemplateLinked = new Aws.VerifiedPermissions.Inputs.PolicyDefinitionTemplateLinkedArgs
{
PolicyTemplateId = "string",
Principal = new Aws.VerifiedPermissions.Inputs.PolicyDefinitionTemplateLinkedPrincipalArgs
{
EntityId = "string",
EntityType = "string",
},
Resource = new Aws.VerifiedPermissions.Inputs.PolicyDefinitionTemplateLinkedResourceArgs
{
EntityId = "string",
EntityType = "string",
},
},
},
});
example, err := verifiedpermissions.NewPolicy(ctx, "examplepolicyResourceResourceFromVerifiedpermissionspolicy", &verifiedpermissions.PolicyArgs{
PolicyStoreId: pulumi.String("string"),
Definition: &verifiedpermissions.PolicyDefinitionArgs{
Static: &verifiedpermissions.PolicyDefinitionStaticArgs{
Statement: pulumi.String("string"),
Description: pulumi.String("string"),
},
TemplateLinked: &verifiedpermissions.PolicyDefinitionTemplateLinkedArgs{
PolicyTemplateId: pulumi.String("string"),
Principal: &verifiedpermissions.PolicyDefinitionTemplateLinkedPrincipalArgs{
EntityId: pulumi.String("string"),
EntityType: pulumi.String("string"),
},
Resource: &verifiedpermissions.PolicyDefinitionTemplateLinkedResourceArgs{
EntityId: pulumi.String("string"),
EntityType: pulumi.String("string"),
},
},
},
})
var examplepolicyResourceResourceFromVerifiedpermissionspolicy = new Policy("examplepolicyResourceResourceFromVerifiedpermissionspolicy", PolicyArgs.builder()
.policyStoreId("string")
.definition(PolicyDefinitionArgs.builder()
.static_(PolicyDefinitionStaticArgs.builder()
.statement("string")
.description("string")
.build())
.templateLinked(PolicyDefinitionTemplateLinkedArgs.builder()
.policyTemplateId("string")
.principal(PolicyDefinitionTemplateLinkedPrincipalArgs.builder()
.entityId("string")
.entityType("string")
.build())
.resource(PolicyDefinitionTemplateLinkedResourceArgs.builder()
.entityId("string")
.entityType("string")
.build())
.build())
.build())
.build());
examplepolicy_resource_resource_from_verifiedpermissionspolicy = aws.verifiedpermissions.Policy("examplepolicyResourceResourceFromVerifiedpermissionspolicy",
policy_store_id="string",
definition={
"static": {
"statement": "string",
"description": "string",
},
"template_linked": {
"policy_template_id": "string",
"principal": {
"entity_id": "string",
"entity_type": "string",
},
"resource": {
"entity_id": "string",
"entity_type": "string",
},
},
})
const examplepolicyResourceResourceFromVerifiedpermissionspolicy = new aws.verifiedpermissions.Policy("examplepolicyResourceResourceFromVerifiedpermissionspolicy", {
policyStoreId: "string",
definition: {
static: {
statement: "string",
description: "string",
},
templateLinked: {
policyTemplateId: "string",
principal: {
entityId: "string",
entityType: "string",
},
resource: {
entityId: "string",
entityType: "string",
},
},
},
});
type: aws:verifiedpermissions:Policy
properties:
definition:
static:
description: string
statement: string
templateLinked:
policyTemplateId: string
principal:
entityId: string
entityType: string
resource:
entityId: string
entityType: string
policyStoreId: string
Policy 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 Policy resource accepts the following input properties:
- Policy
Store stringId - The Policy Store ID of the policy store.
- Definition
Policy
Definition - The definition of the policy. See Definition below.
- Policy
Store stringId - The Policy Store ID of the policy store.
- Definition
Policy
Definition Args - The definition of the policy. See Definition below.
- policy
Store StringId - The Policy Store ID of the policy store.
- definition
Policy
Definition - The definition of the policy. See Definition below.
- policy
Store stringId - The Policy Store ID of the policy store.
- definition
Policy
Definition - The definition of the policy. See Definition below.
- policy_
store_ strid - The Policy Store ID of the policy store.
- definition
Policy
Definition Args - The definition of the policy. See Definition below.
- policy
Store StringId - The Policy Store ID of the policy store.
- definition Property Map
- The definition of the policy. See Definition below.
Outputs
All input properties are implicitly available as output properties. Additionally, the Policy resource produces the following output properties:
- Created
Date string - The date the policy was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Policy
Id string - The Policy ID of the policy.
- Created
Date string - The date the policy was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Policy
Id string - The Policy ID of the policy.
- created
Date String - The date the policy was created.
- id String
- The provider-assigned unique ID for this managed resource.
- policy
Id String - The Policy ID of the policy.
- created
Date string - The date the policy was created.
- id string
- The provider-assigned unique ID for this managed resource.
- policy
Id string - The Policy ID of the policy.
- created_
date str - The date the policy was created.
- id str
- The provider-assigned unique ID for this managed resource.
- policy_
id str - The Policy ID of the policy.
- created
Date String - The date the policy was created.
- id String
- The provider-assigned unique ID for this managed resource.
- policy
Id String - The Policy ID of the policy.
Look up 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): Policy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_date: Optional[str] = None,
definition: Optional[PolicyDefinitionArgs] = None,
policy_id: Optional[str] = None,
policy_store_id: Optional[str] = None) -> Policy
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)
public static Policy get(String name, Output<String> id, PolicyState 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.
- Created
Date string - The date the policy was created.
- Definition
Policy
Definition - The definition of the policy. See Definition below.
- Policy
Id string - The Policy ID of the policy.
- Policy
Store stringId - The Policy Store ID of the policy store.
- Created
Date string - The date the policy was created.
- Definition
Policy
Definition Args - The definition of the policy. See Definition below.
- Policy
Id string - The Policy ID of the policy.
- Policy
Store stringId - The Policy Store ID of the policy store.
- created
Date String - The date the policy was created.
- definition
Policy
Definition - The definition of the policy. See Definition below.
- policy
Id String - The Policy ID of the policy.
- policy
Store StringId - The Policy Store ID of the policy store.
- created
Date string - The date the policy was created.
- definition
Policy
Definition - The definition of the policy. See Definition below.
- policy
Id string - The Policy ID of the policy.
- policy
Store stringId - The Policy Store ID of the policy store.
- created_
date str - The date the policy was created.
- definition
Policy
Definition Args - The definition of the policy. See Definition below.
- policy_
id str - The Policy ID of the policy.
- policy_
store_ strid - The Policy Store ID of the policy store.
- created
Date String - The date the policy was created.
- definition Property Map
- The definition of the policy. See Definition below.
- policy
Id String - The Policy ID of the policy.
- policy
Store StringId - The Policy Store ID of the policy store.
Supporting Types
PolicyDefinition, PolicyDefinitionArgs
- Static
Policy
Definition Static - The static policy statement. See Static below.
- Template
Linked PolicyDefinition Template Linked - The template linked policy. See Template Linked below.
- Static
Policy
Definition Static - The static policy statement. See Static below.
- Template
Linked PolicyDefinition Template Linked - The template linked policy. See Template Linked below.
- static_
Policy
Definition Static - The static policy statement. See Static below.
- template
Linked PolicyDefinition Template Linked - The template linked policy. See Template Linked below.
- static
Policy
Definition Static - The static policy statement. See Static below.
- template
Linked PolicyDefinition Template Linked - The template linked policy. See Template Linked below.
- static
Policy
Definition Static - The static policy statement. See Static below.
- template_
linked PolicyDefinition Template Linked - The template linked policy. See Template Linked below.
- static Property Map
- The static policy statement. See Static below.
- template
Linked Property Map - The template linked policy. See Template Linked below.
PolicyDefinitionStatic, PolicyDefinitionStaticArgs
- Statement string
- The statement of the static policy.
- Description string
- The description of the static policy.
- Statement string
- The statement of the static policy.
- Description string
- The description of the static policy.
- statement String
- The statement of the static policy.
- description String
- The description of the static policy.
- statement string
- The statement of the static policy.
- description string
- The description of the static policy.
- statement str
- The statement of the static policy.
- description str
- The description of the static policy.
- statement String
- The statement of the static policy.
- description String
- The description of the static policy.
PolicyDefinitionTemplateLinked, PolicyDefinitionTemplateLinkedArgs
- Policy
Template stringId - The ID of the template.
- Principal
Policy
Definition Template Linked Principal - The principal of the template linked policy.
- Resource
Policy
Definition Template Linked Resource - The resource of the template linked policy.
- Policy
Template stringId - The ID of the template.
- Principal
Policy
Definition Template Linked Principal - The principal of the template linked policy.
- Resource
Policy
Definition Template Linked Resource - The resource of the template linked policy.
- policy
Template StringId - The ID of the template.
- principal
Policy
Definition Template Linked Principal - The principal of the template linked policy.
- resource
Policy
Definition Template Linked Resource - The resource of the template linked policy.
- policy
Template stringId - The ID of the template.
- principal
Policy
Definition Template Linked Principal - The principal of the template linked policy.
- resource
Policy
Definition Template Linked Resource - The resource of the template linked policy.
- policy_
template_ strid - The ID of the template.
- principal
Policy
Definition Template Linked Principal - The principal of the template linked policy.
- resource
Policy
Definition Template Linked Resource - The resource of the template linked policy.
- policy
Template StringId - The ID of the template.
- principal Property Map
- The principal of the template linked policy.
- resource Property Map
- The resource of the template linked policy.
PolicyDefinitionTemplateLinkedPrincipal, PolicyDefinitionTemplateLinkedPrincipalArgs
- Entity
Id string - The entity ID of the principal.
- Entity
Type string - The entity type of the principal.
- Entity
Id string - The entity ID of the principal.
- Entity
Type string - The entity type of the principal.
- entity
Id String - The entity ID of the principal.
- entity
Type String - The entity type of the principal.
- entity
Id string - The entity ID of the principal.
- entity
Type string - The entity type of the principal.
- entity_
id str - The entity ID of the principal.
- entity_
type str - The entity type of the principal.
- entity
Id String - The entity ID of the principal.
- entity
Type String - The entity type of the principal.
PolicyDefinitionTemplateLinkedResource, PolicyDefinitionTemplateLinkedResourceArgs
- Entity
Id string - The entity ID of the resource.
- Entity
Type string - The entity type of the resource.
- Entity
Id string - The entity ID of the resource.
- Entity
Type string - The entity type of the resource.
- entity
Id String - The entity ID of the resource.
- entity
Type String - The entity type of the resource.
- entity
Id string - The entity ID of the resource.
- entity
Type string - The entity type of the resource.
- entity_
id str - The entity ID of the resource.
- entity_
type str - The entity type of the resource.
- entity
Id String - The entity ID of the resource.
- entity
Type String - The entity type of the resource.
Import
Using pulumi import
, import Verified Permissions Policy using the policy_id,policy_store_id
. For example:
$ pulumi import aws:verifiedpermissions/policy:Policy example policy-id-12345678,policy-store-id-12345678
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.