1. Packages
  2. Ibm Provider
  3. API Docs
  4. getIamPolicyTemplateVersion
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.getIamPolicyTemplateVersion

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Provides a read-only data source to retrieve information about a policy_template. You can then reference the fields of the data source in other resources within the same configuration by using interpolation syntax.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const policyTemplate = ibm.getIamPolicyTemplateVersion({
        policyTemplateId: ibm_iam_policy_template_version.policy_template.policy_template_id,
        version: "version",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    policy_template = ibm.get_iam_policy_template_version(policy_template_id=ibm_iam_policy_template_version["policy_template"]["policy_template_id"],
        version="version")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.LookupIamPolicyTemplateVersion(ctx, &ibm.LookupIamPolicyTemplateVersionArgs{
    			PolicyTemplateId: ibm_iam_policy_template_version.Policy_template.Policy_template_id,
    			Version:          "version",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var policyTemplate = Ibm.GetIamPolicyTemplateVersion.Invoke(new()
        {
            PolicyTemplateId = ibm_iam_policy_template_version.Policy_template.Policy_template_id,
            Version = "version",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetIamPolicyTemplateVersionArgs;
    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 policyTemplate = IbmFunctions.getIamPolicyTemplateVersion(GetIamPolicyTemplateVersionArgs.builder()
                .policyTemplateId(ibm_iam_policy_template_version.policy_template().policy_template_id())
                .version("version")
                .build());
    
        }
    }
    
    variables:
      policyTemplate:
        fn::invoke:
          function: ibm:getIamPolicyTemplateVersion
          arguments:
            policyTemplateId: ${ibm_iam_policy_template_version.policy_template.policy_template_id}
            version: version
    

    Using getIamPolicyTemplateVersion

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getIamPolicyTemplateVersion(args: GetIamPolicyTemplateVersionArgs, opts?: InvokeOptions): Promise<GetIamPolicyTemplateVersionResult>
    function getIamPolicyTemplateVersionOutput(args: GetIamPolicyTemplateVersionOutputArgs, opts?: InvokeOptions): Output<GetIamPolicyTemplateVersionResult>
    def get_iam_policy_template_version(policy_template_id: Optional[str] = None,
                                        version: Optional[str] = None,
                                        opts: Optional[InvokeOptions] = None) -> GetIamPolicyTemplateVersionResult
    def get_iam_policy_template_version_output(policy_template_id: Optional[pulumi.Input[str]] = None,
                                        version: Optional[pulumi.Input[str]] = None,
                                        opts: Optional[InvokeOptions] = None) -> Output[GetIamPolicyTemplateVersionResult]
    func LookupIamPolicyTemplateVersion(ctx *Context, args *LookupIamPolicyTemplateVersionArgs, opts ...InvokeOption) (*LookupIamPolicyTemplateVersionResult, error)
    func LookupIamPolicyTemplateVersionOutput(ctx *Context, args *LookupIamPolicyTemplateVersionOutputArgs, opts ...InvokeOption) LookupIamPolicyTemplateVersionResultOutput

    > Note: This function is named LookupIamPolicyTemplateVersion in the Go SDK.

    public static class GetIamPolicyTemplateVersion 
    {
        public static Task<GetIamPolicyTemplateVersionResult> InvokeAsync(GetIamPolicyTemplateVersionArgs args, InvokeOptions? opts = null)
        public static Output<GetIamPolicyTemplateVersionResult> Invoke(GetIamPolicyTemplateVersionInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIamPolicyTemplateVersionResult> getIamPolicyTemplateVersion(GetIamPolicyTemplateVersionArgs args, InvokeOptions options)
    public static Output<GetIamPolicyTemplateVersionResult> getIamPolicyTemplateVersion(GetIamPolicyTemplateVersionArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getIamPolicyTemplateVersion:getIamPolicyTemplateVersion
      arguments:
        # arguments dictionary

    The following arguments are supported:

    PolicyTemplateId string
    The policy template ID.
    Version string
    The policy template version.
    PolicyTemplateId string
    The policy template ID.
    Version string
    The policy template version.
    policyTemplateId String
    The policy template ID.
    version String
    The policy template version.
    policyTemplateId string
    The policy template ID.
    version string
    The policy template version.
    policy_template_id str
    The policy template ID.
    version str
    The policy template version.
    policyTemplateId String
    The policy template ID.
    version String
    The policy template version.

    getIamPolicyTemplateVersion Result

    The following output properties are available:

    AccountId string
    (String) Enterprise account ID where this template will be created.
    Committed bool
    (Boolean) Committed status of the template version.
    Description string
    (String) Description of the policy. This is shown in child accounts when an access group or trusted profile template uses the policy template to assign access.
    Id string
    The unique identifier of the policy_template.
    Name string
    (String) Required field when creating a new template. Otherwise this field is optional. If the field is included it will change the name value for all existing versions of the template.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character.
    Policies List<GetIamPolicyTemplateVersionPolicy>
    (List) The core set of properties associated with the template's policy objet. Nested schema for policy:
    PolicyTemplateId string
    Version string
    The policy_template version.
    AccountId string
    (String) Enterprise account ID where this template will be created.
    Committed bool
    (Boolean) Committed status of the template version.
    Description string
    (String) Description of the policy. This is shown in child accounts when an access group or trusted profile template uses the policy template to assign access.
    Id string
    The unique identifier of the policy_template.
    Name string
    (String) Required field when creating a new template. Otherwise this field is optional. If the field is included it will change the name value for all existing versions of the template.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character.
    Policies []GetIamPolicyTemplateVersionPolicy
    (List) The core set of properties associated with the template's policy objet. Nested schema for policy:
    PolicyTemplateId string
    Version string
    The policy_template version.
    accountId String
    (String) Enterprise account ID where this template will be created.
    committed Boolean
    (Boolean) Committed status of the template version.
    description String
    (String) Description of the policy. This is shown in child accounts when an access group or trusted profile template uses the policy template to assign access.
    id String
    The unique identifier of the policy_template.
    name String
    (String) Required field when creating a new template. Otherwise this field is optional. If the field is included it will change the name value for all existing versions of the template.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character.
    policies List<GetIamPolicyTemplateVersionPolicy>
    (List) The core set of properties associated with the template's policy objet. Nested schema for policy:
    policyTemplateId String
    version String
    The policy_template version.
    accountId string
    (String) Enterprise account ID where this template will be created.
    committed boolean
    (Boolean) Committed status of the template version.
    description string
    (String) Description of the policy. This is shown in child accounts when an access group or trusted profile template uses the policy template to assign access.
    id string
    The unique identifier of the policy_template.
    name string
    (String) Required field when creating a new template. Otherwise this field is optional. If the field is included it will change the name value for all existing versions of the template.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character.
    policies GetIamPolicyTemplateVersionPolicy[]
    (List) The core set of properties associated with the template's policy objet. Nested schema for policy:
    policyTemplateId string
    version string
    The policy_template version.
    account_id str
    (String) Enterprise account ID where this template will be created.
    committed bool
    (Boolean) Committed status of the template version.
    description str
    (String) Description of the policy. This is shown in child accounts when an access group or trusted profile template uses the policy template to assign access.
    id str
    The unique identifier of the policy_template.
    name str
    (String) Required field when creating a new template. Otherwise this field is optional. If the field is included it will change the name value for all existing versions of the template.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character.
    policies Sequence[GetIamPolicyTemplateVersionPolicy]
    (List) The core set of properties associated with the template's policy objet. Nested schema for policy:
    policy_template_id str
    version str
    The policy_template version.
    accountId String
    (String) Enterprise account ID where this template will be created.
    committed Boolean
    (Boolean) Committed status of the template version.
    description String
    (String) Description of the policy. This is shown in child accounts when an access group or trusted profile template uses the policy template to assign access.
    id String
    The unique identifier of the policy_template.
    name String
    (String) Required field when creating a new template. Otherwise this field is optional. If the field is included it will change the name value for all existing versions of the template.

    • Constraints: The maximum length is 30 characters. The minimum length is 1 character.
    policies List<Property Map>
    (List) The core set of properties associated with the template's policy objet. Nested schema for policy:
    policyTemplateId String
    version String
    The policy_template version.

    Supporting Types

    GetIamPolicyTemplateVersionPolicy

    Description string
    (String) Description of the policy. This is shown in child accounts when an access group or trusted profile template uses the policy template to assign access.
    Pattern string
    (String) Indicates pattern of rule, either 'time-based-conditions:once', 'time-based-conditions:weekly:all-day', or 'time-based-conditions:weekly:custom-hours'.
    Resources List<GetIamPolicyTemplateVersionPolicyResource>
    (List) The resource attributes to which the policy grants access. Nested schema for resource:
    Roles List<string>
    (List) A set of displayNames.
    RuleConditions List<GetIamPolicyTemplateVersionPolicyRuleCondition>
    RuleOperator string
    Type string
    (String) The policy type: 'access'.
    Description string
    (String) Description of the policy. This is shown in child accounts when an access group or trusted profile template uses the policy template to assign access.
    Pattern string
    (String) Indicates pattern of rule, either 'time-based-conditions:once', 'time-based-conditions:weekly:all-day', or 'time-based-conditions:weekly:custom-hours'.
    Resources []GetIamPolicyTemplateVersionPolicyResource
    (List) The resource attributes to which the policy grants access. Nested schema for resource:
    Roles []string
    (List) A set of displayNames.
    RuleConditions []GetIamPolicyTemplateVersionPolicyRuleCondition
    RuleOperator string
    Type string
    (String) The policy type: 'access'.
    description String
    (String) Description of the policy. This is shown in child accounts when an access group or trusted profile template uses the policy template to assign access.
    pattern String
    (String) Indicates pattern of rule, either 'time-based-conditions:once', 'time-based-conditions:weekly:all-day', or 'time-based-conditions:weekly:custom-hours'.
    resources List<GetIamPolicyTemplateVersionPolicyResource>
    (List) The resource attributes to which the policy grants access. Nested schema for resource:
    roles List<String>
    (List) A set of displayNames.
    ruleConditions List<GetIamPolicyTemplateVersionPolicyRuleCondition>
    ruleOperator String
    type String
    (String) The policy type: 'access'.
    description string
    (String) Description of the policy. This is shown in child accounts when an access group or trusted profile template uses the policy template to assign access.
    pattern string
    (String) Indicates pattern of rule, either 'time-based-conditions:once', 'time-based-conditions:weekly:all-day', or 'time-based-conditions:weekly:custom-hours'.
    resources GetIamPolicyTemplateVersionPolicyResource[]
    (List) The resource attributes to which the policy grants access. Nested schema for resource:
    roles string[]
    (List) A set of displayNames.
    ruleConditions GetIamPolicyTemplateVersionPolicyRuleCondition[]
    ruleOperator string
    type string
    (String) The policy type: 'access'.
    description str
    (String) Description of the policy. This is shown in child accounts when an access group or trusted profile template uses the policy template to assign access.
    pattern str
    (String) Indicates pattern of rule, either 'time-based-conditions:once', 'time-based-conditions:weekly:all-day', or 'time-based-conditions:weekly:custom-hours'.
    resources Sequence[GetIamPolicyTemplateVersionPolicyResource]
    (List) The resource attributes to which the policy grants access. Nested schema for resource:
    roles Sequence[str]
    (List) A set of displayNames.
    rule_conditions Sequence[GetIamPolicyTemplateVersionPolicyRuleCondition]
    rule_operator str
    type str
    (String) The policy type: 'access'.
    description String
    (String) Description of the policy. This is shown in child accounts when an access group or trusted profile template uses the policy template to assign access.
    pattern String
    (String) Indicates pattern of rule, either 'time-based-conditions:once', 'time-based-conditions:weekly:all-day', or 'time-based-conditions:weekly:custom-hours'.
    resources List<Property Map>
    (List) The resource attributes to which the policy grants access. Nested schema for resource:
    roles List<String>
    (List) A set of displayNames.
    ruleConditions List<Property Map>
    ruleOperator String
    type String
    (String) The policy type: 'access'.

    GetIamPolicyTemplateVersionPolicyResource

    Attributes List<GetIamPolicyTemplateVersionPolicyResourceAttribute>
    (List) List of resource attributes to which the policy grants access. Nested schema for attributes:
    Tags List<GetIamPolicyTemplateVersionPolicyResourceTag>
    (List) Optional list of resource tags to which the policy grants access. Nested schema for tags:
    Attributes []GetIamPolicyTemplateVersionPolicyResourceAttribute
    (List) List of resource attributes to which the policy grants access. Nested schema for attributes:
    Tags []GetIamPolicyTemplateVersionPolicyResourceTag
    (List) Optional list of resource tags to which the policy grants access. Nested schema for tags:
    attributes List<GetIamPolicyTemplateVersionPolicyResourceAttribute>
    (List) List of resource attributes to which the policy grants access. Nested schema for attributes:
    tags List<GetIamPolicyTemplateVersionPolicyResourceTag>
    (List) Optional list of resource tags to which the policy grants access. Nested schema for tags:
    attributes GetIamPolicyTemplateVersionPolicyResourceAttribute[]
    (List) List of resource attributes to which the policy grants access. Nested schema for attributes:
    tags GetIamPolicyTemplateVersionPolicyResourceTag[]
    (List) Optional list of resource tags to which the policy grants access. Nested schema for tags:
    attributes Sequence[GetIamPolicyTemplateVersionPolicyResourceAttribute]
    (List) List of resource attributes to which the policy grants access. Nested schema for attributes:
    tags Sequence[GetIamPolicyTemplateVersionPolicyResourceTag]
    (List) Optional list of resource tags to which the policy grants access. Nested schema for tags:
    attributes List<Property Map>
    (List) List of resource attributes to which the policy grants access. Nested schema for attributes:
    tags List<Property Map>
    (List) Optional list of resource tags to which the policy grants access. Nested schema for tags:

    GetIamPolicyTemplateVersionPolicyResourceAttribute

    Key string
    (String) The name of an attribute.
    Operator string
    (String) The operator of an attribute.
    Value string
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    Key string
    (String) The name of an attribute.
    Operator string
    (String) The operator of an attribute.
    Value string
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    key String
    (String) The name of an attribute.
    operator String
    (String) The operator of an attribute.
    value String
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    key string
    (String) The name of an attribute.
    operator string
    (String) The operator of an attribute.
    value string
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    key str
    (String) The name of an attribute.
    operator str
    (String) The operator of an attribute.
    value str
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    key String
    (String) The name of an attribute.
    operator String
    (String) The operator of an attribute.
    value String
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.

    GetIamPolicyTemplateVersionPolicyResourceTag

    Key string
    (String) The name of an attribute.
    Operator string
    (String) The operator of an attribute.
    Value string
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    Key string
    (String) The name of an attribute.
    Operator string
    (String) The operator of an attribute.
    Value string
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    key String
    (String) The name of an attribute.
    operator String
    (String) The operator of an attribute.
    value String
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    key string
    (String) The name of an attribute.
    operator string
    (String) The operator of an attribute.
    value string
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    key str
    (String) The name of an attribute.
    operator str
    (String) The operator of an attribute.
    value str
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    key String
    (String) The name of an attribute.
    operator String
    (String) The operator of an attribute.
    value String
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.

    GetIamPolicyTemplateVersionPolicyRuleCondition

    Conditions List<GetIamPolicyTemplateVersionPolicyRuleConditionCondition>
    (List) List of conditions associated with a policy, e.g., time-based conditions that grant access over a certain time period. Nested schema for conditions:
    Key string
    (String) The name of an attribute.
    Operator string
    (String) The operator of an attribute.
    Values List<string>
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    Conditions []GetIamPolicyTemplateVersionPolicyRuleConditionCondition
    (List) List of conditions associated with a policy, e.g., time-based conditions that grant access over a certain time period. Nested schema for conditions:
    Key string
    (String) The name of an attribute.
    Operator string
    (String) The operator of an attribute.
    Values []string
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    conditions List<GetIamPolicyTemplateVersionPolicyRuleConditionCondition>
    (List) List of conditions associated with a policy, e.g., time-based conditions that grant access over a certain time period. Nested schema for conditions:
    key String
    (String) The name of an attribute.
    operator String
    (String) The operator of an attribute.
    values List<String>
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    conditions GetIamPolicyTemplateVersionPolicyRuleConditionCondition[]
    (List) List of conditions associated with a policy, e.g., time-based conditions that grant access over a certain time period. Nested schema for conditions:
    key string
    (String) The name of an attribute.
    operator string
    (String) The operator of an attribute.
    values string[]
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    conditions Sequence[GetIamPolicyTemplateVersionPolicyRuleConditionCondition]
    (List) List of conditions associated with a policy, e.g., time-based conditions that grant access over a certain time period. Nested schema for conditions:
    key str
    (String) The name of an attribute.
    operator str
    (String) The operator of an attribute.
    values Sequence[str]
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    conditions List<Property Map>
    (List) List of conditions associated with a policy, e.g., time-based conditions that grant access over a certain time period. Nested schema for conditions:
    key String
    (String) The name of an attribute.
    operator String
    (String) The operator of an attribute.
    values List<String>
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.

    GetIamPolicyTemplateVersionPolicyRuleConditionCondition

    Key string
    (String) The name of an attribute.
    Operator string
    (String) The operator of an attribute.
    Values List<string>
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    Key string
    (String) The name of an attribute.
    Operator string
    (String) The operator of an attribute.
    Values []string
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    key String
    (String) The name of an attribute.
    operator String
    (String) The operator of an attribute.
    values List<String>
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    key string
    (String) The name of an attribute.
    operator string
    (String) The operator of an attribute.
    values string[]
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    key str
    (String) The name of an attribute.
    operator str
    (String) The operator of an attribute.
    values Sequence[str]
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.
    key String
    (String) The name of an attribute.
    operator String
    (String) The operator of an attribute.
    values List<String>
    (String) The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or an array of strings (e.g., array of days to permit access) for rule attribute.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud