1. Packages
  2. Athenz Provider
  3. API Docs
  4. getPolicy
athenz 1.0.45 published on Tuesday, Apr 15, 2025 by athenz

athenz.getPolicy

Explore with Pulumi AI

athenz logo
athenz 1.0.45 published on Tuesday, Apr 15, 2025 by athenz

    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 dictionary

    The following arguments are supported:

    Domain string
    • The Athenz domain name.
    Name string
    • The name of the specific Athenz policy.
    Assertions List<GetPolicyAssertion>
    Id string
    The ID of this resource.
    Tags Dictionary<string, string>
    Domain string
    • The Athenz domain name.
    Name string
    • The name of the specific Athenz policy.
    Assertions []GetPolicyAssertion
    Id string
    The ID of this resource.
    Tags map[string]string
    domain String
    • The Athenz domain name.
    name String
    • The name of the specific Athenz policy.
    assertions List<GetPolicyAssertion>
    id String
    The ID of this resource.
    tags Map<String,String>
    domain string
    • The Athenz domain name.
    name string
    • The name of the specific Athenz policy.
    assertions GetPolicyAssertion[]
    id string
    The ID of this resource.
    tags {[key: string]: string}
    domain str
    • The Athenz domain name.
    name str
    • The name of the specific Athenz policy.
    assertions Sequence[GetPolicyAssertion]
    id str
    The ID of this resource.
    tags 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.
    tags 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<GetPolicyAssertion>
    Tags 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 []GetPolicyAssertion
    Tags 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<GetPolicyAssertion>
    tags 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 GetPolicyAssertion[]
    tags {[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[GetPolicyAssertion]
    tags 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>
    tags Map<String>

    Supporting Types

    GetPolicyAssertion

    Action string
    Conditions List<GetPolicyAssertionCondition>
    Effect string
    Id double
    The ID of this resource.
    Resource string
    Role string
    CaseSensitive bool
    Action string
    Conditions []GetPolicyAssertionCondition
    Effect string
    Id float64
    The ID of this resource.
    Resource string
    Role string
    CaseSensitive bool
    action String
    conditions List<GetPolicyAssertionCondition>
    effect String
    id Double
    The ID of this resource.
    resource String
    role String
    caseSensitive Boolean
    action string
    conditions GetPolicyAssertionCondition[]
    effect string
    id number
    The ID of this resource.
    resource string
    role string
    caseSensitive boolean
    action String
    conditions List<Property Map>
    effect String
    id Number
    The ID of this resource.
    resource String
    role String
    caseSensitive Boolean

    GetPolicyAssertionCondition

    GetPolicyAssertionConditionEnforcementstate

    Operator double
    Value string
    Operator float64
    Value string
    operator Double
    value String
    operator number
    value string
    operator float
    value str
    operator Number
    value String

    GetPolicyAssertionConditionId

    Operator double
    Value string
    Operator float64
    Value string
    operator Double
    value String
    operator number
    value string
    operator float
    value str
    operator Number
    value String

    GetPolicyAssertionConditionInstance

    Operator double
    Value string
    Operator float64
    Value string
    operator Double
    value String
    operator number
    value string
    operator float
    value str
    operator Number
    value String

    GetPolicyAssertionConditionScopeall

    Operator double
    Value string
    Operator float64
    Value string
    operator Double
    value String
    operator number
    value string
    operator float
    value str
    operator Number
    value String

    GetPolicyAssertionConditionScopeaw

    Operator double
    Value string
    Operator float64
    Value string
    operator Double
    value String
    operator number
    value string
    operator float
    value str
    operator Number
    value String

    GetPolicyAssertionConditionScopeonprem

    Operator double
    Value string
    Operator float64
    Value string
    operator Double
    value String
    operator number
    value string
    operator float
    value str
    operator Number
    value String

    Package Details

    Repository
    athenz athenz/terraform-provider-athenz
    License
    Notes
    This Pulumi package is based on the athenz Terraform Provider.
    athenz logo
    athenz 1.0.45 published on Tuesday, Apr 15, 2025 by athenz