getAccessIdentityProvider

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

Example Usage

using System.Collections.Generic;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var mainAccessIdentityProvider = Cloudflare.GetAccessIdentityProvider.Invoke(new()
    {
        Name = "Google SSO",
        AccountId = "example-account-id",
    });

    var mainAccessApplication = new Cloudflare.AccessApplication("mainAccessApplication", new()
    {
        ZoneId = "example.com",
        Name = "name",
        Domain = "name.example.com",
        Type = "self_hosted",
        SessionDuration = "24h",
        AllowedIdps = new[]
        {
            mainAccessIdentityProvider.Apply(getAccessIdentityProviderResult => getAccessIdentityProviderResult.Id),
        },
        AutoRedirectToIdentity = true,
    });

});
package main

import (
	"github.com/pulumi/pulumi-cloudflare/sdk/v4/go/cloudflare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		mainAccessIdentityProvider, err := cloudflare.LookupAccessIdentityProvider(ctx, &GetAccessIdentityProviderArgs{
			Name:      "Google SSO",
			AccountId: pulumi.StringRef("example-account-id"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = cloudflare.NewAccessApplication(ctx, "mainAccessApplication", &cloudflare.AccessApplicationArgs{
			ZoneId:          pulumi.String("example.com"),
			Name:            pulumi.String("name"),
			Domain:          pulumi.String("name.example.com"),
			Type:            pulumi.String("self_hosted"),
			SessionDuration: pulumi.String("24h"),
			AllowedIdps: pulumi.StringArray{
				pulumi.String(mainAccessIdentityProvider.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 mainAccessIdentityProvider = CloudflareFunctions.getAccessIdentityProvider(GetAccessIdentityProviderArgs.builder()
            .name("Google SSO")
            .accountId("example-account-id")
            .build());

        var mainAccessApplication = new AccessApplication("mainAccessApplication", AccessApplicationArgs.builder()        
            .zoneId("example.com")
            .name("name")
            .domain("name.example.com")
            .type("self_hosted")
            .sessionDuration("24h")
            .allowedIdps(mainAccessIdentityProvider.applyValue(getAccessIdentityProviderResult -> getAccessIdentityProviderResult.id()))
            .autoRedirectToIdentity(true)
            .build());

    }
}
import pulumi
import pulumi_cloudflare as cloudflare

main_access_identity_provider = cloudflare.get_access_identity_provider(name="Google SSO",
    account_id="example-account-id")
main_access_application = cloudflare.AccessApplication("mainAccessApplication",
    zone_id="example.com",
    name="name",
    domain="name.example.com",
    type="self_hosted",
    session_duration="24h",
    allowed_idps=[main_access_identity_provider.id],
    auto_redirect_to_identity=True)
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const mainAccessIdentityProvider = cloudflare.getAccessIdentityProvider({
    name: "Google SSO",
    accountId: "example-account-id",
});
const mainAccessApplication = new cloudflare.AccessApplication("mainAccessApplication", {
    zoneId: "example.com",
    name: "name",
    domain: "name.example.com",
    type: "self_hosted",
    sessionDuration: "24h",
    allowedIdps: [mainAccessIdentityProvider.then(mainAccessIdentityProvider => mainAccessIdentityProvider.id)],
    autoRedirectToIdentity: true,
});
resources:
  mainAccessApplication:
    type: cloudflare:AccessApplication
    properties:
      zoneId: example.com
      name: name
      domain: name.example.com
      type: self_hosted
      sessionDuration: 24h
      allowedIdps:
        - ${mainAccessIdentityProvider.id}
      autoRedirectToIdentity: true
variables:
  mainAccessIdentityProvider:
    fn::invoke:
      Function: cloudflare:getAccessIdentityProvider
      Arguments:
        name: Google SSO
        accountId: example-account-id

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 for which to look for an Access Identity Provider. Conflicts with zone_id.

ZoneId string

The Zone's ID. Conflicts with account_id.

Name string

Access Identity Provider name to search for.

AccountId string

The account for which to look for an Access Identity Provider. Conflicts with zone_id.

ZoneId string

The Zone's ID. Conflicts with account_id.

name String

Access Identity Provider name to search for.

accountId String

The account for which to look for an Access Identity Provider. Conflicts with zone_id.

zoneId String

The Zone's ID. Conflicts with account_id.

name string

Access Identity Provider name to search for.

accountId string

The account for which to look for an Access Identity Provider. Conflicts with zone_id.

zoneId string

The Zone's ID. Conflicts with account_id.

name str

Access Identity Provider name to search for.

account_id str

The account for which to look for an Access Identity Provider. Conflicts with zone_id.

zone_id str

The Zone's ID. Conflicts with account_id.

name String

Access Identity Provider name to search for.

accountId String

The account for which to look for an Access Identity Provider. Conflicts with zone_id.

zoneId String

The Zone's ID. Conflicts with 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

Type string

Access Identity Provider Type

AccountId string
ZoneId string
Id string

The provider-assigned unique ID for this managed resource.

Name string

Access Identity Provider Name

Type string

Access Identity Provider Type

AccountId string
ZoneId string
id String

The provider-assigned unique ID for this managed resource.

name String

Access Identity Provider Name

type String

Access Identity Provider Type

accountId String
zoneId String
id string

The provider-assigned unique ID for this managed resource.

name string

Access Identity Provider Name

type string

Access Identity Provider Type

accountId string
zoneId string
id str

The provider-assigned unique ID for this managed resource.

name str

Access Identity Provider Name

type str

Access Identity Provider Type

account_id str
zone_id str
id String

The provider-assigned unique ID for this managed resource.

name String

Access Identity Provider Name

type String

Access Identity Provider Type

accountId String
zoneId String

Package Details

Repository
https://github.com/pulumi/pulumi-cloudflare
License
Apache-2.0
Notes

This Pulumi package is based on the cloudflare Terraform Provider.