ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud
ibm.getIamPolicyTemplateVersion
Explore with Pulumi AI
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:
- Policy
Template stringId - The policy template ID.
- Version string
- The policy template version.
- Policy
Template stringId - The policy template ID.
- Version string
- The policy template version.
- policy
Template StringId - The policy template ID.
- version String
- The policy template version.
- policy
Template stringId - The policy template ID.
- version string
- The policy template version.
- policy_
template_ strid - The policy template ID.
- version str
- The policy template version.
- policy
Template StringId - The policy template ID.
- version String
- The policy template version.
getIamPolicyTemplateVersion Result
The following output properties are available:
- Account
Id 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 is1
character.
- Constraints: The maximum length is
- Policies
List<Get
Iam Policy Template Version Policy> - (List) The core set of properties associated with the template's policy objet. Nested schema for policy:
- Policy
Template stringId - Version string
- The policy_template version.
- Account
Id 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 is1
character.
- Constraints: The maximum length is
- Policies
[]Get
Iam Policy Template Version Policy - (List) The core set of properties associated with the template's policy objet. Nested schema for policy:
- Policy
Template stringId - Version string
- The policy_template version.
- account
Id 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 is1
character.
- Constraints: The maximum length is
- policies
List<Get
Iam Policy Template Version Policy> - (List) The core set of properties associated with the template's policy objet. Nested schema for policy:
- policy
Template StringId - version String
- The policy_template version.
- account
Id 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 is1
character.
- Constraints: The maximum length is
- policies
Get
Iam Policy Template Version Policy[] - (List) The core set of properties associated with the template's policy objet. Nested schema for policy:
- policy
Template stringId - 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 is1
character.
- Constraints: The maximum length is
- policies
Sequence[Get
Iam Policy Template Version Policy] - (List) The core set of properties associated with the template's policy objet. Nested schema for policy:
- policy_
template_ strid - version str
- The policy_template version.
- account
Id 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 is1
character.
- Constraints: The maximum length is
- policies List<Property Map>
- (List) The core set of properties associated with the template's policy objet. Nested schema for policy:
- policy
Template StringId - 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<Get
Iam Policy Template Version Policy Resource> - (List) The resource attributes to which the policy grants access. Nested schema for resource:
- Roles List<string>
- (List) A set of displayNames.
- Rule
Conditions List<GetIam Policy Template Version Policy Rule Condition> - Rule
Operator 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
[]Get
Iam Policy Template Version Policy Resource - (List) The resource attributes to which the policy grants access. Nested schema for resource:
- Roles []string
- (List) A set of displayNames.
- Rule
Conditions []GetIam Policy Template Version Policy Rule Condition - Rule
Operator 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<Get
Iam Policy Template Version Policy Resource> - (List) The resource attributes to which the policy grants access. Nested schema for resource:
- roles List<String>
- (List) A set of displayNames.
- rule
Conditions List<GetIam Policy Template Version Policy Rule Condition> - rule
Operator 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
Get
Iam Policy Template Version Policy Resource[] - (List) The resource attributes to which the policy grants access. Nested schema for resource:
- roles string[]
- (List) A set of displayNames.
- rule
Conditions GetIam Policy Template Version Policy Rule Condition[] - rule
Operator 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[Get
Iam Policy Template Version Policy Resource] - (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[GetIam Policy Template Version Policy Rule Condition] - 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.
- rule
Conditions List<Property Map> - rule
Operator String - type String
- (String) The policy type: 'access'.
GetIamPolicyTemplateVersionPolicyResource
- Attributes
List<Get
Iam Policy Template Version Policy Resource Attribute> - (List) List of resource attributes to which the policy grants access. Nested schema for attributes:
- List<Get
Iam Policy Template Version Policy Resource Tag> - (List) Optional list of resource tags to which the policy grants access. Nested schema for tags:
- Attributes
[]Get
Iam Policy Template Version Policy Resource Attribute - (List) List of resource attributes to which the policy grants access. Nested schema for attributes:
- []Get
Iam Policy Template Version Policy Resource Tag - (List) Optional list of resource tags to which the policy grants access. Nested schema for tags:
- attributes
List<Get
Iam Policy Template Version Policy Resource Attribute> - (List) List of resource attributes to which the policy grants access. Nested schema for attributes:
- List<Get
Iam Policy Template Version Policy Resource Tag> - (List) Optional list of resource tags to which the policy grants access. Nested schema for tags:
- attributes
Get
Iam Policy Template Version Policy Resource Attribute[] - (List) List of resource attributes to which the policy grants access. Nested schema for attributes:
- Get
Iam Policy Template Version Policy Resource Tag[] - (List) Optional list of resource tags to which the policy grants access. Nested schema for tags:
- attributes
Sequence[Get
Iam Policy Template Version Policy Resource Attribute] - (List) List of resource attributes to which the policy grants access. Nested schema for attributes:
- Sequence[Get
Iam Policy Template Version Policy Resource Tag] - (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:
- 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 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 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<Get
Iam Policy Template Version Policy Rule Condition Condition> - (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
[]Get
Iam Policy Template Version Policy Rule Condition Condition - (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<Get
Iam Policy Template Version Policy Rule Condition Condition> - (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
Get
Iam Policy Template Version Policy Rule Condition Condition[] - (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[Get
Iam Policy Template Version Policy Rule Condition Condition] - (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.