athenz 1.0.45 published on Tuesday, Apr 15, 2025 by athenz
athenz.getPolicy
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as athenz from "@pulumi/athenz";
const config = new pulumi.Config();
const policyName = config.require("policyName");
const selected = athenz.getPolicy({
    name: policyName,
    domain: "some_domain",
});
import pulumi
import pulumi_athenz as athenz
config = pulumi.Config()
policy_name = config.require("policyName")
selected = athenz.get_policy(name=policy_name,
    domain="some_domain")
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/athenz/athenz"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		policyName := cfg.Require("policyName")
		_, err := athenz.LookupPolicy(ctx, &athenz.LookupPolicyArgs{
			Name:   policyName,
			Domain: "some_domain",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Athenz = Pulumi.Athenz;
return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var policyName = config.Require("policyName");
    var selected = Athenz.GetPolicy.Invoke(new()
    {
        Name = policyName,
        Domain = "some_domain",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.athenz.AthenzFunctions;
import com.pulumi.athenz.inputs.GetPolicyArgs;
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 config = ctx.config();
        final var policyName = config.get("policyName");
        final var selected = AthenzFunctions.getPolicy(GetPolicyArgs.builder()
            .name(policyName)
            .domain("some_domain")
            .build());
    }
}
configuration:
  policyName:
    type: string
variables:
  selected:
    fn::invoke:
      function: athenz:getPolicy
      arguments:
        name: ${policyName}
        domain: some_domain
Using getPolicy
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 getPolicy(args: GetPolicyArgs, opts?: InvokeOptions): Promise<GetPolicyResult>
function getPolicyOutput(args: GetPolicyOutputArgs, opts?: InvokeOptions): Output<GetPolicyResult>def get_policy(assertions: Optional[Sequence[GetPolicyAssertion]] = None,
               domain: Optional[str] = None,
               id: Optional[str] = None,
               name: Optional[str] = None,
               tags: Optional[Mapping[str, str]] = None,
               opts: Optional[InvokeOptions] = None) -> GetPolicyResult
def get_policy_output(assertions: Optional[pulumi.Input[Sequence[pulumi.Input[GetPolicyAssertionArgs]]]] = None,
               domain: Optional[pulumi.Input[str]] = None,
               id: Optional[pulumi.Input[str]] = None,
               name: Optional[pulumi.Input[str]] = None,
               tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetPolicyResult]func LookupPolicy(ctx *Context, args *LookupPolicyArgs, opts ...InvokeOption) (*LookupPolicyResult, error)
func LookupPolicyOutput(ctx *Context, args *LookupPolicyOutputArgs, opts ...InvokeOption) LookupPolicyResultOutput> Note: This function is named LookupPolicy in the Go SDK.
public static class GetPolicy 
{
    public static Task<GetPolicyResult> InvokeAsync(GetPolicyArgs args, InvokeOptions? opts = null)
    public static Output<GetPolicyResult> Invoke(GetPolicyInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetPolicyResult> getPolicy(GetPolicyArgs args, InvokeOptions options)
public static Output<GetPolicyResult> getPolicy(GetPolicyArgs args, InvokeOptions options)
fn::invoke:
  function: athenz:index/getPolicy:getPolicy
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Domain string
 - The Athenz domain name.
 
- Name string
 - The name of the specific Athenz policy.
 
- Assertions
List<Get
Policy Assertion>  - Id string
 - The ID of this resource.
 - Dictionary<string, string>
 
- Domain string
 - The Athenz domain name.
 
- Name string
 - The name of the specific Athenz policy.
 
- Assertions
[]Get
Policy Assertion  - Id string
 - The ID of this resource.
 - map[string]string
 
- domain String
 - The Athenz domain name.
 
- name String
 - The name of the specific Athenz policy.
 
- assertions
List<Get
Policy Assertion>  - id String
 - The ID of this resource.
 - Map<String,String>
 
- domain string
 - The Athenz domain name.
 
- name string
 - The name of the specific Athenz policy.
 
- assertions
Get
Policy Assertion[]  - id string
 - The ID of this resource.
 - {[key: string]: string}
 
- domain str
 - The Athenz domain name.
 
- name str
 - The name of the specific Athenz policy.
 
- assertions
Sequence[Get
Policy Assertion]  - id str
 - The ID of this resource.
 - Mapping[str, str]
 
- domain String
 - The Athenz domain name.
 
- name String
 - The name of the specific Athenz policy.
 
- assertions List<Property Map>
 - id String
 - The ID of this resource.
 - Map<String>
 
getPolicy Result
The following output properties are available:
- Domain string
 - The Athenz domain name.
 
- Id string
 - The ID of this resource.
 - Name string
 - The name of the specific Athenz policy.
 
- Assertions
List<Get
Policy Assertion>  - Dictionary<string, string>
 
- Domain string
 - The Athenz domain name.
 
- Id string
 - The ID of this resource.
 - Name string
 - The name of the specific Athenz policy.
 
- Assertions
[]Get
Policy Assertion  - map[string]string
 
- domain String
 - The Athenz domain name.
 
- id String
 - The ID of this resource.
 - name String
 - The name of the specific Athenz policy.
 
- assertions
List<Get
Policy Assertion>  - Map<String,String>
 
- domain string
 - The Athenz domain name.
 
- id string
 - The ID of this resource.
 - name string
 - The name of the specific Athenz policy.
 
- assertions
Get
Policy Assertion[]  - {[key: string]: string}
 
- domain str
 - The Athenz domain name.
 
- id str
 - The ID of this resource.
 - name str
 - The name of the specific Athenz policy.
 
- assertions
Sequence[Get
Policy Assertion]  - Mapping[str, str]
 
- domain String
 - The Athenz domain name.
 
- id String
 - The ID of this resource.
 - name String
 - The name of the specific Athenz policy.
 
- assertions List<Property Map>
 - Map<String>
 
Supporting Types
GetPolicyAssertion  
- Action string
 - Conditions
List<Get
Policy Assertion Condition>  - Effect string
 - Id double
 - The ID of this resource.
 - Resource string
 - Role string
 - Case
Sensitive bool 
- Action string
 - Conditions
[]Get
Policy Assertion Condition  - Effect string
 - Id float64
 - The ID of this resource.
 - Resource string
 - Role string
 - Case
Sensitive bool 
- action String
 - conditions
List<Get
Policy Assertion Condition>  - effect String
 - id Double
 - The ID of this resource.
 - resource String
 - role String
 - case
Sensitive Boolean 
- action string
 - conditions
Get
Policy Assertion Condition[]  - effect string
 - id number
 - The ID of this resource.
 - resource string
 - role string
 - case
Sensitive boolean 
- action str
 - conditions
Sequence[Get
Policy Assertion Condition]  - effect str
 - id float
 - The ID of this resource.
 - resource str
 - role str
 - case_
sensitive bool 
- action String
 - conditions List<Property Map>
 - effect String
 - id Number
 - The ID of this resource.
 - resource String
 - role String
 - case
Sensitive Boolean 
GetPolicyAssertionCondition   
- Enforcementstates
List<Get
Policy Assertion Condition Enforcementstate>  - Ids
List<Get
Policy Assertion Condition Id>  - Instances
List<Get
Policy Assertion Condition Instance>  - Scopealls
List<Get
Policy Assertion Condition Scopeall>  - Scopeaws
List<Get
Policy Assertion Condition Scopeaw>  - Scopeonprems
List<Get
Policy Assertion Condition Scopeonprem>  
- enforcementstates
List<Get
Policy Assertion Condition Enforcementstate>  - ids
List<Get
Policy Assertion Condition Id>  - instances
List<Get
Policy Assertion Condition Instance>  - scopealls
List<Get
Policy Assertion Condition Scopeall>  - scopeaws
List<Get
Policy Assertion Condition Scopeaw>  - scopeonprems
List<Get
Policy Assertion Condition Scopeonprem>  
- enforcementstates
Sequence[Get
Policy Assertion Condition Enforcementstate]  - ids
Sequence[Get
Policy Assertion Condition Id]  - instances
Sequence[Get
Policy Assertion Condition Instance]  - scopealls
Sequence[Get
Policy Assertion Condition Scopeall]  - scopeaws
Sequence[Get
Policy Assertion Condition Scopeaw]  - scopeonprems
Sequence[Get
Policy Assertion Condition Scopeonprem]  
GetPolicyAssertionConditionEnforcementstate    
GetPolicyAssertionConditionId    
GetPolicyAssertionConditionInstance    
GetPolicyAssertionConditionScopeall    
GetPolicyAssertionConditionScopeaw    
GetPolicyAssertionConditionScopeonprem    
Package Details
- Repository
 - athenz athenz/terraform-provider-athenz
 - License
 - Notes
 - This Pulumi package is based on the 
athenzTerraform Provider.