Cloudflare v5.33.1 published on Wednesday, Jun 26, 2024 by Pulumi
cloudflare.getAccessIdentityProvider
Explore with Pulumi AI
Use this data source to lookup a single Access Identity Provider by name.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const example = cloudflare.getAccessIdentityProvider({
    name: "Google SSO",
    accountId: "f037e56e89293a057740de681ac9abbe",
});
const exampleAccessApplication = new cloudflare.AccessApplication("example", {
    zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
    name: "name",
    domain: "name.example.com",
    type: "self_hosted",
    sessionDuration: "24h",
    allowedIdps: [example.then(example => example.id)],
    autoRedirectToIdentity: true,
});
import pulumi
import pulumi_cloudflare as cloudflare
example = cloudflare.get_access_identity_provider(name="Google SSO",
    account_id="f037e56e89293a057740de681ac9abbe")
example_access_application = cloudflare.AccessApplication("example",
    zone_id="0da42c8d2132a9ddaf714f9e7c920711",
    name="name",
    domain="name.example.com",
    type="self_hosted",
    session_duration="24h",
    allowed_idps=[example.id],
    auto_redirect_to_identity=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 {
		example, err := cloudflare.LookupAccessIdentityProvider(ctx, &cloudflare.LookupAccessIdentityProviderArgs{
			Name:      "Google SSO",
			AccountId: pulumi.StringRef("f037e56e89293a057740de681ac9abbe"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = cloudflare.NewAccessApplication(ctx, "example", &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(example.Id),
			},
			AutoRedirectToIdentity: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() => 
{
    var example = Cloudflare.GetAccessIdentityProvider.Invoke(new()
    {
        Name = "Google SSO",
        AccountId = "f037e56e89293a057740de681ac9abbe",
    });
    var exampleAccessApplication = new Cloudflare.AccessApplication("example", new()
    {
        ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
        Name = "name",
        Domain = "name.example.com",
        Type = "self_hosted",
        SessionDuration = "24h",
        AllowedIdps = new[]
        {
            example.Apply(getAccessIdentityProviderResult => getAccessIdentityProviderResult.Id),
        },
        AutoRedirectToIdentity = true,
    });
});
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 example = 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(example.applyValue(getAccessIdentityProviderResult -> getAccessIdentityProviderResult.id()))
            .autoRedirectToIdentity(true)
            .build());
    }
}
resources:
  exampleAccessApplication:
    type: cloudflare:AccessApplication
    name: example
    properties:
      zoneId: 0da42c8d2132a9ddaf714f9e7c920711
      name: name
      domain: name.example.com
      type: self_hosted
      sessionDuration: 24h
      allowedIdps:
        - ${example.id}
      autoRedirectToIdentity: true
variables:
  example:
    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 dictionaryThe following arguments are supported:
- 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. 
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.
 - Account
Id string - The account identifier to target for the resource. Must provide only one of 
zone_id,account_id. - Zone
Id 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.
 - Account
Id string - The account identifier to target for the resource. Must provide only one of 
zone_id,account_id. - Zone
Id 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.
 - account
Id String - The account identifier to target for the resource. Must provide only one of 
zone_id,account_id. - zone
Id 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.
 - account
Id string - The account identifier to target for the resource. Must provide only one of 
zone_id,account_id. - zone
Id 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.
 - account
Id String - The account identifier to target for the resource. Must provide only one of 
zone_id,account_id. - zone
Id 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 
cloudflareTerraform Provider.