1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. kms
  5. Policy
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.kms.Policy

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a KMS Policy resource. Permission policies which can be bound to the Application Access Points.

    For information about KMS Policy and how to use it, see What is Policy.

    NOTE: Available since v1.210.0.

    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,
               access_control_rules: Optional[str] = None,
               kms_instance_id: Optional[str] = None,
               permissions: Optional[Sequence[str]] = None,
               policy_name: Optional[str] = None,
               resources: Optional[Sequence[str]] = None,
               description: Optional[str] = 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: alicloud:kms: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 alicloudPolicyResource = new AliCloud.Kms.Policy("alicloudPolicyResource", new()
    {
        AccessControlRules = "string",
        KmsInstanceId = "string",
        Permissions = new[]
        {
            "string",
        },
        PolicyName = "string",
        Resources = new[]
        {
            "string",
        },
        Description = "string",
    });
    
    example, err := kms.NewPolicy(ctx, "alicloudPolicyResource", &kms.PolicyArgs{
    	AccessControlRules: pulumi.String("string"),
    	KmsInstanceId:      pulumi.String("string"),
    	Permissions: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	PolicyName: pulumi.String("string"),
    	Resources: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    })
    
    var alicloudPolicyResource = new Policy("alicloudPolicyResource", PolicyArgs.builder()
        .accessControlRules("string")
        .kmsInstanceId("string")
        .permissions("string")
        .policyName("string")
        .resources("string")
        .description("string")
        .build());
    
    alicloud_policy_resource = alicloud.kms.Policy("alicloudPolicyResource",
        access_control_rules="string",
        kms_instance_id="string",
        permissions=["string"],
        policy_name="string",
        resources=["string"],
        description="string")
    
    const alicloudPolicyResource = new alicloud.kms.Policy("alicloudPolicyResource", {
        accessControlRules: "string",
        kmsInstanceId: "string",
        permissions: ["string"],
        policyName: "string",
        resources: ["string"],
        description: "string",
    });
    
    type: alicloud:kms:Policy
    properties:
        accessControlRules: string
        description: string
        kmsInstanceId: string
        permissions:
            - string
        policyName: string
        resources:
            - 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

    The Policy resource accepts the following input properties:

    AccessControlRules string
    Network Rules in JSON struct.
    KmsInstanceId string
    KMS instance .
    Permissions List<string>
    Allowed permissions (RBAC)Optional values:"RbacPermission/Template/CryptoServiceKeyUser" and "RbacPermission/Template/CryptoServiceSecretUser".
    PolicyName string
    Policy Name.
    Resources List<string>
    The resources that the permission policy allows to access.Use "key/${KeyId}" or "key/" to specify a key or all keys.Use "secret/${SecretName}" or "secret/" to specify a secret or all secrets.
    Description string
    Description.
    AccessControlRules string
    Network Rules in JSON struct.
    KmsInstanceId string
    KMS instance .
    Permissions []string
    Allowed permissions (RBAC)Optional values:"RbacPermission/Template/CryptoServiceKeyUser" and "RbacPermission/Template/CryptoServiceSecretUser".
    PolicyName string
    Policy Name.
    Resources []string
    The resources that the permission policy allows to access.Use "key/${KeyId}" or "key/" to specify a key or all keys.Use "secret/${SecretName}" or "secret/" to specify a secret or all secrets.
    Description string
    Description.
    accessControlRules String
    Network Rules in JSON struct.
    kmsInstanceId String
    KMS instance .
    permissions List<String>
    Allowed permissions (RBAC)Optional values:"RbacPermission/Template/CryptoServiceKeyUser" and "RbacPermission/Template/CryptoServiceSecretUser".
    policyName String
    Policy Name.
    resources List<String>
    The resources that the permission policy allows to access.Use "key/${KeyId}" or "key/" to specify a key or all keys.Use "secret/${SecretName}" or "secret/" to specify a secret or all secrets.
    description String
    Description.
    accessControlRules string
    Network Rules in JSON struct.
    kmsInstanceId string
    KMS instance .
    permissions string[]
    Allowed permissions (RBAC)Optional values:"RbacPermission/Template/CryptoServiceKeyUser" and "RbacPermission/Template/CryptoServiceSecretUser".
    policyName string
    Policy Name.
    resources string[]
    The resources that the permission policy allows to access.Use "key/${KeyId}" or "key/" to specify a key or all keys.Use "secret/${SecretName}" or "secret/" to specify a secret or all secrets.
    description string
    Description.
    access_control_rules str
    Network Rules in JSON struct.
    kms_instance_id str
    KMS instance .
    permissions Sequence[str]
    Allowed permissions (RBAC)Optional values:"RbacPermission/Template/CryptoServiceKeyUser" and "RbacPermission/Template/CryptoServiceSecretUser".
    policy_name str
    Policy Name.
    resources Sequence[str]
    The resources that the permission policy allows to access.Use "key/${KeyId}" or "key/" to specify a key or all keys.Use "secret/${SecretName}" or "secret/" to specify a secret or all secrets.
    description str
    Description.
    accessControlRules String
    Network Rules in JSON struct.
    kmsInstanceId String
    KMS instance .
    permissions List<String>
    Allowed permissions (RBAC)Optional values:"RbacPermission/Template/CryptoServiceKeyUser" and "RbacPermission/Template/CryptoServiceSecretUser".
    policyName String
    Policy Name.
    resources List<String>
    The resources that the permission policy allows to access.Use "key/${KeyId}" or "key/" to specify a key or all keys.Use "secret/${SecretName}" or "secret/" to specify a secret or all secrets.
    description String
    Description.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Policy 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 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,
            access_control_rules: Optional[str] = None,
            description: Optional[str] = None,
            kms_instance_id: Optional[str] = None,
            permissions: Optional[Sequence[str]] = None,
            policy_name: Optional[str] = None,
            resources: Optional[Sequence[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.
    The following state arguments are supported:
    AccessControlRules string
    Network Rules in JSON struct.
    Description string
    Description.
    KmsInstanceId string
    KMS instance .
    Permissions List<string>
    Allowed permissions (RBAC)Optional values:"RbacPermission/Template/CryptoServiceKeyUser" and "RbacPermission/Template/CryptoServiceSecretUser".
    PolicyName string
    Policy Name.
    Resources List<string>
    The resources that the permission policy allows to access.Use "key/${KeyId}" or "key/" to specify a key or all keys.Use "secret/${SecretName}" or "secret/" to specify a secret or all secrets.
    AccessControlRules string
    Network Rules in JSON struct.
    Description string
    Description.
    KmsInstanceId string
    KMS instance .
    Permissions []string
    Allowed permissions (RBAC)Optional values:"RbacPermission/Template/CryptoServiceKeyUser" and "RbacPermission/Template/CryptoServiceSecretUser".
    PolicyName string
    Policy Name.
    Resources []string
    The resources that the permission policy allows to access.Use "key/${KeyId}" or "key/" to specify a key or all keys.Use "secret/${SecretName}" or "secret/" to specify a secret or all secrets.
    accessControlRules String
    Network Rules in JSON struct.
    description String
    Description.
    kmsInstanceId String
    KMS instance .
    permissions List<String>
    Allowed permissions (RBAC)Optional values:"RbacPermission/Template/CryptoServiceKeyUser" and "RbacPermission/Template/CryptoServiceSecretUser".
    policyName String
    Policy Name.
    resources List<String>
    The resources that the permission policy allows to access.Use "key/${KeyId}" or "key/" to specify a key or all keys.Use "secret/${SecretName}" or "secret/" to specify a secret or all secrets.
    accessControlRules string
    Network Rules in JSON struct.
    description string
    Description.
    kmsInstanceId string
    KMS instance .
    permissions string[]
    Allowed permissions (RBAC)Optional values:"RbacPermission/Template/CryptoServiceKeyUser" and "RbacPermission/Template/CryptoServiceSecretUser".
    policyName string
    Policy Name.
    resources string[]
    The resources that the permission policy allows to access.Use "key/${KeyId}" or "key/" to specify a key or all keys.Use "secret/${SecretName}" or "secret/" to specify a secret or all secrets.
    access_control_rules str
    Network Rules in JSON struct.
    description str
    Description.
    kms_instance_id str
    KMS instance .
    permissions Sequence[str]
    Allowed permissions (RBAC)Optional values:"RbacPermission/Template/CryptoServiceKeyUser" and "RbacPermission/Template/CryptoServiceSecretUser".
    policy_name str
    Policy Name.
    resources Sequence[str]
    The resources that the permission policy allows to access.Use "key/${KeyId}" or "key/" to specify a key or all keys.Use "secret/${SecretName}" or "secret/" to specify a secret or all secrets.
    accessControlRules String
    Network Rules in JSON struct.
    description String
    Description.
    kmsInstanceId String
    KMS instance .
    permissions List<String>
    Allowed permissions (RBAC)Optional values:"RbacPermission/Template/CryptoServiceKeyUser" and "RbacPermission/Template/CryptoServiceSecretUser".
    policyName String
    Policy Name.
    resources List<String>
    The resources that the permission policy allows to access.Use "key/${KeyId}" or "key/" to specify a key or all keys.Use "secret/${SecretName}" or "secret/" to specify a secret or all secrets.

    Import

    KMS Policy can be imported using the id, e.g.

    $ pulumi import alicloud:kms/policy:Policy example <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi