1. Packages
  2. Cloudflare
  3. API Docs
  4. getAccessIdentityProvider
Cloudflare v5.11.0 published on Wednesday, Sep 20, 2023 by Pulumi

cloudflare.getAccessIdentityProvider

Explore with Pulumi AI

cloudflare logo
Cloudflare v5.11.0 published on Wednesday, Sep 20, 2023 by Pulumi

    Use this data source to lookup a single Access Identity Provider by name.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleAccessIdentityProvider = Cloudflare.GetAccessIdentityProvider.Invoke(new()
        {
            Name = "Google SSO",
            AccountId = "f037e56e89293a057740de681ac9abbe",
        });
    
        var exampleAccessApplication = new Cloudflare.AccessApplication("exampleAccessApplication", new()
        {
            ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
            Name = "name",
            Domain = "name.example.com",
            Type = "self_hosted",
            SessionDuration = "24h",
            AllowedIdps = new[]
            {
                exampleAccessIdentityProvider.Apply(getAccessIdentityProviderResult => getAccessIdentityProviderResult.Id),
            },
            AutoRedirectToIdentity = true,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleAccessIdentityProvider, err := cloudflare.LookupAccessIdentityProvider(ctx, &cloudflare.LookupAccessIdentityProviderArgs{
    			Name:      "Google SSO",
    			AccountId: pulumi.StringRef("f037e56e89293a057740de681ac9abbe"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = cloudflare.NewAccessApplication(ctx, "exampleAccessApplication", &cloudflare.AccessApplicationArgs{
    			ZoneId:          pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
    			Name:            pulumi.String("name"),
    			Domain:          pulumi.String("name.example.com"),
    			Type:            pulumi.String("self_hosted"),
    			SessionDuration: pulumi.String("24h"),
    			AllowedIdps: pulumi.StringArray{
    				*pulumi.String(exampleAccessIdentityProvider.Id),
    			},
    			AutoRedirectToIdentity: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.CloudflareFunctions;
    import com.pulumi.cloudflare.inputs.GetAccessIdentityProviderArgs;
    import com.pulumi.cloudflare.AccessApplication;
    import com.pulumi.cloudflare.AccessApplicationArgs;
    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 exampleAccessIdentityProvider = CloudflareFunctions.getAccessIdentityProvider(GetAccessIdentityProviderArgs.builder()
                .name("Google SSO")
                .accountId("f037e56e89293a057740de681ac9abbe")
                .build());
    
            var exampleAccessApplication = new AccessApplication("exampleAccessApplication", AccessApplicationArgs.builder()        
                .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
                .name("name")
                .domain("name.example.com")
                .type("self_hosted")
                .sessionDuration("24h")
                .allowedIdps(exampleAccessIdentityProvider.applyValue(getAccessIdentityProviderResult -> getAccessIdentityProviderResult.id()))
                .autoRedirectToIdentity(true)
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_access_identity_provider = cloudflare.get_access_identity_provider(name="Google SSO",
        account_id="f037e56e89293a057740de681ac9abbe")
    example_access_application = cloudflare.AccessApplication("exampleAccessApplication",
        zone_id="0da42c8d2132a9ddaf714f9e7c920711",
        name="name",
        domain="name.example.com",
        type="self_hosted",
        session_duration="24h",
        allowed_idps=[example_access_identity_provider.id],
        auto_redirect_to_identity=True)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleAccessIdentityProvider = cloudflare.getAccessIdentityProvider({
        name: "Google SSO",
        accountId: "f037e56e89293a057740de681ac9abbe",
    });
    const exampleAccessApplication = new cloudflare.AccessApplication("exampleAccessApplication", {
        zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
        name: "name",
        domain: "name.example.com",
        type: "self_hosted",
        sessionDuration: "24h",
        allowedIdps: [exampleAccessIdentityProvider.then(exampleAccessIdentityProvider => exampleAccessIdentityProvider.id)],
        autoRedirectToIdentity: true,
    });
    
    resources:
      exampleAccessApplication:
        type: cloudflare:AccessApplication
        properties:
          zoneId: 0da42c8d2132a9ddaf714f9e7c920711
          name: name
          domain: name.example.com
          type: self_hosted
          sessionDuration: 24h
          allowedIdps:
            - ${exampleAccessIdentityProvider.id}
          autoRedirectToIdentity: true
    variables:
      exampleAccessIdentityProvider:
        fn::invoke:
          Function: cloudflare:getAccessIdentityProvider
          Arguments:
            name: Google SSO
            accountId: f037e56e89293a057740de681ac9abbe
    

    Using getAccessIdentityProvider

    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 getAccessIdentityProvider(args: GetAccessIdentityProviderArgs, opts?: InvokeOptions): Promise<GetAccessIdentityProviderResult>
    function getAccessIdentityProviderOutput(args: GetAccessIdentityProviderOutputArgs, opts?: InvokeOptions): Output<GetAccessIdentityProviderResult>
    def get_access_identity_provider(account_id: Optional[str] = None,
                                     name: Optional[str] = None,
                                     zone_id: Optional[str] = None,
                                     opts: Optional[InvokeOptions] = None) -> GetAccessIdentityProviderResult
    def get_access_identity_provider_output(account_id: Optional[pulumi.Input[str]] = None,
                                     name: Optional[pulumi.Input[str]] = None,
                                     zone_id: Optional[pulumi.Input[str]] = None,
                                     opts: Optional[InvokeOptions] = None) -> Output[GetAccessIdentityProviderResult]
    func LookupAccessIdentityProvider(ctx *Context, args *LookupAccessIdentityProviderArgs, opts ...InvokeOption) (*LookupAccessIdentityProviderResult, error)
    func LookupAccessIdentityProviderOutput(ctx *Context, args *LookupAccessIdentityProviderOutputArgs, opts ...InvokeOption) LookupAccessIdentityProviderResultOutput

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

    public static class GetAccessIdentityProvider 
    {
        public static Task<GetAccessIdentityProviderResult> InvokeAsync(GetAccessIdentityProviderArgs args, InvokeOptions? opts = null)
        public static Output<GetAccessIdentityProviderResult> Invoke(GetAccessIdentityProviderInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccessIdentityProviderResult> getAccessIdentityProvider(GetAccessIdentityProviderArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: cloudflare:index/getAccessIdentityProvider:getAccessIdentityProvider
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string

    Access Identity Provider name to search for.

    AccountId string

    The account identifier to target for the resource. Must provide only one of zone_id, account_id.

    ZoneId string

    The zone identifier to target for the resource. Must provide only one of zone_id, account_id.

    Name string

    Access Identity Provider name to search for.

    AccountId string

    The account identifier to target for the resource. Must provide only one of zone_id, account_id.

    ZoneId string

    The zone identifier to target for the resource. Must provide only one of zone_id, account_id.

    name String

    Access Identity Provider name to search for.

    accountId String

    The account identifier to target for the resource. Must provide only one of zone_id, account_id.

    zoneId String

    The zone identifier to target for the resource. Must provide only one of zone_id, account_id.

    name string

    Access Identity Provider name to search for.

    accountId string

    The account identifier to target for the resource. Must provide only one of zone_id, account_id.

    zoneId string

    The zone identifier to target for the resource. Must provide only one of zone_id, account_id.

    name str

    Access Identity Provider name to search for.

    account_id str

    The account identifier to target for the resource. Must provide only one of zone_id, account_id.

    zone_id str

    The zone identifier to target for the resource. Must provide only one of zone_id, account_id.

    name String

    Access Identity Provider name to search for.

    accountId String

    The account identifier to target for the resource. Must provide only one of zone_id, account_id.

    zoneId String

    The zone identifier to target for the resource. Must provide only one of zone_id, account_id.

    getAccessIdentityProvider Result

    The following output properties are available:

    Id string

    The provider-assigned unique ID for this managed resource.

    Name string

    Access Identity Provider name to search for.

    Type string

    Access Identity Provider Type.

    AccountId string

    The account identifier to target for the resource. Must provide only one of zone_id, account_id.

    ZoneId string

    The zone identifier to target for the resource. Must provide only one of zone_id, account_id.

    Id string

    The provider-assigned unique ID for this managed resource.

    Name string

    Access Identity Provider name to search for.

    Type string

    Access Identity Provider Type.

    AccountId string

    The account identifier to target for the resource. Must provide only one of zone_id, account_id.

    ZoneId string

    The zone identifier to target for the resource. Must provide only one of zone_id, account_id.

    id String

    The provider-assigned unique ID for this managed resource.

    name String

    Access Identity Provider name to search for.

    type String

    Access Identity Provider Type.

    accountId String

    The account identifier to target for the resource. Must provide only one of zone_id, account_id.

    zoneId String

    The zone identifier to target for the resource. Must provide only one of zone_id, account_id.

    id string

    The provider-assigned unique ID for this managed resource.

    name string

    Access Identity Provider name to search for.

    type string

    Access Identity Provider Type.

    accountId string

    The account identifier to target for the resource. Must provide only one of zone_id, account_id.

    zoneId string

    The zone identifier to target for the resource. Must provide only one of zone_id, account_id.

    id str

    The provider-assigned unique ID for this managed resource.

    name str

    Access Identity Provider name to search for.

    type str

    Access Identity Provider Type.

    account_id str

    The account identifier to target for the resource. Must provide only one of zone_id, account_id.

    zone_id str

    The zone identifier to target for the resource. Must provide only one of zone_id, account_id.

    id String

    The provider-assigned unique ID for this managed resource.

    name String

    Access Identity Provider name to search for.

    type String

    Access Identity Provider Type.

    accountId String

    The account identifier to target for the resource. Must provide only one of zone_id, account_id.

    zoneId String

    The zone identifier to target for the resource. Must provide only one of zone_id, account_id.

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the cloudflare Terraform Provider.

    cloudflare logo
    Cloudflare v5.11.0 published on Wednesday, Sep 20, 2023 by Pulumi