1. Packages
  2. Auth0
  3. API Docs
  4. OrganizationConnections
Auth0 v3.3.1 published on Thursday, Mar 14, 2024 by Pulumi

auth0.OrganizationConnections

Explore with Pulumi AI

auth0 logo
Auth0 v3.3.1 published on Thursday, Mar 14, 2024 by Pulumi

    With this resource, you can manage enabled connections on an organization.

    !> This resource manages all the connections enabled for an organization. In contrast, the auth0.OrganizationConnection resource appends a connection to an organization. To avoid potential issues, it is recommended not to use this resource in conjunction with the auth0.OrganizationConnection resource when managing connections for the same organization id.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as auth0 from "@pulumi/auth0";
    
    const myConnection_1 = new auth0.Connection("myConnection-1", {strategy: "auth0"});
    const myConnection_2 = new auth0.Connection("myConnection-2", {strategy: "auth0"});
    const myOrganization = new auth0.Organization("myOrganization", {displayName: "My Organization"});
    const one_to_many = new auth0.OrganizationConnections("one-to-many", {
        organizationId: myOrganization.id,
        enabledConnections: [
            {
                connectionId: myConnection_1.id,
                assignMembershipOnLogin: true,
            },
            {
                connectionId: myConnection_2.id,
                assignMembershipOnLogin: true,
            },
        ],
    });
    
    import pulumi
    import pulumi_auth0 as auth0
    
    my_connection_1 = auth0.Connection("myConnection-1", strategy="auth0")
    my_connection_2 = auth0.Connection("myConnection-2", strategy="auth0")
    my_organization = auth0.Organization("myOrganization", display_name="My Organization")
    one_to_many = auth0.OrganizationConnections("one-to-many",
        organization_id=my_organization.id,
        enabled_connections=[
            auth0.OrganizationConnectionsEnabledConnectionArgs(
                connection_id=my_connection_1.id,
                assign_membership_on_login=True,
            ),
            auth0.OrganizationConnectionsEnabledConnectionArgs(
                connection_id=my_connection_2.id,
                assign_membership_on_login=True,
            ),
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-auth0/sdk/v3/go/auth0"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := auth0.NewConnection(ctx, "myConnection-1", &auth0.ConnectionArgs{
    			Strategy: pulumi.String("auth0"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = auth0.NewConnection(ctx, "myConnection-2", &auth0.ConnectionArgs{
    			Strategy: pulumi.String("auth0"),
    		})
    		if err != nil {
    			return err
    		}
    		myOrganization, err := auth0.NewOrganization(ctx, "myOrganization", &auth0.OrganizationArgs{
    			DisplayName: pulumi.String("My Organization"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = auth0.NewOrganizationConnections(ctx, "one-to-many", &auth0.OrganizationConnectionsArgs{
    			OrganizationId: myOrganization.ID(),
    			EnabledConnections: auth0.OrganizationConnectionsEnabledConnectionArray{
    				&auth0.OrganizationConnectionsEnabledConnectionArgs{
    					ConnectionId:            myConnection_1.ID(),
    					AssignMembershipOnLogin: pulumi.Bool(true),
    				},
    				&auth0.OrganizationConnectionsEnabledConnectionArgs{
    					ConnectionId:            myConnection_2.ID(),
    					AssignMembershipOnLogin: pulumi.Bool(true),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Auth0 = Pulumi.Auth0;
    
    return await Deployment.RunAsync(() => 
    {
        var myConnection_1 = new Auth0.Connection("myConnection-1", new()
        {
            Strategy = "auth0",
        });
    
        var myConnection_2 = new Auth0.Connection("myConnection-2", new()
        {
            Strategy = "auth0",
        });
    
        var myOrganization = new Auth0.Organization("myOrganization", new()
        {
            DisplayName = "My Organization",
        });
    
        var one_to_many = new Auth0.OrganizationConnections("one-to-many", new()
        {
            OrganizationId = myOrganization.Id,
            EnabledConnections = new[]
            {
                new Auth0.Inputs.OrganizationConnectionsEnabledConnectionArgs
                {
                    ConnectionId = myConnection_1.Id,
                    AssignMembershipOnLogin = true,
                },
                new Auth0.Inputs.OrganizationConnectionsEnabledConnectionArgs
                {
                    ConnectionId = myConnection_2.Id,
                    AssignMembershipOnLogin = true,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.auth0.Connection;
    import com.pulumi.auth0.ConnectionArgs;
    import com.pulumi.auth0.Organization;
    import com.pulumi.auth0.OrganizationArgs;
    import com.pulumi.auth0.OrganizationConnections;
    import com.pulumi.auth0.OrganizationConnectionsArgs;
    import com.pulumi.auth0.inputs.OrganizationConnectionsEnabledConnectionArgs;
    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) {
            var myConnection_1 = new Connection("myConnection-1", ConnectionArgs.builder()        
                .strategy("auth0")
                .build());
    
            var myConnection_2 = new Connection("myConnection-2", ConnectionArgs.builder()        
                .strategy("auth0")
                .build());
    
            var myOrganization = new Organization("myOrganization", OrganizationArgs.builder()        
                .displayName("My Organization")
                .build());
    
            var one_to_many = new OrganizationConnections("one-to-many", OrganizationConnectionsArgs.builder()        
                .organizationId(myOrganization.id())
                .enabledConnections(            
                    OrganizationConnectionsEnabledConnectionArgs.builder()
                        .connectionId(myConnection_1.id())
                        .assignMembershipOnLogin(true)
                        .build(),
                    OrganizationConnectionsEnabledConnectionArgs.builder()
                        .connectionId(myConnection_2.id())
                        .assignMembershipOnLogin(true)
                        .build())
                .build());
    
        }
    }
    
    resources:
      myConnection-1:
        type: auth0:Connection
        properties:
          strategy: auth0
      myConnection-2:
        type: auth0:Connection
        properties:
          strategy: auth0
      myOrganization:
        type: auth0:Organization
        properties:
          displayName: My Organization
      one-to-many:
        type: auth0:OrganizationConnections
        properties:
          organizationId: ${myOrganization.id}
          enabledConnections:
            - connectionId: ${["myConnection-1"].id}
              assignMembershipOnLogin: true
            - connectionId: ${["myConnection-2"].id}
              assignMembershipOnLogin: true
    

    Create OrganizationConnections Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new OrganizationConnections(name: string, args: OrganizationConnectionsArgs, opts?: CustomResourceOptions);
    @overload
    def OrganizationConnections(resource_name: str,
                                args: OrganizationConnectionsArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def OrganizationConnections(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                enabled_connections: Optional[Sequence[OrganizationConnectionsEnabledConnectionArgs]] = None,
                                organization_id: Optional[str] = None)
    func NewOrganizationConnections(ctx *Context, name string, args OrganizationConnectionsArgs, opts ...ResourceOption) (*OrganizationConnections, error)
    public OrganizationConnections(string name, OrganizationConnectionsArgs args, CustomResourceOptions? opts = null)
    public OrganizationConnections(String name, OrganizationConnectionsArgs args)
    public OrganizationConnections(String name, OrganizationConnectionsArgs args, CustomResourceOptions options)
    
    type: auth0:OrganizationConnections
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args OrganizationConnectionsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args OrganizationConnectionsArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args OrganizationConnectionsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OrganizationConnectionsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OrganizationConnectionsArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var organizationConnectionsResource = new Auth0.OrganizationConnections("organizationConnectionsResource", new()
    {
        EnabledConnections = new[]
        {
            new Auth0.Inputs.OrganizationConnectionsEnabledConnectionArgs
            {
                ConnectionId = "string",
                AssignMembershipOnLogin = false,
            },
        },
        OrganizationId = "string",
    });
    
    example, err := auth0.NewOrganizationConnections(ctx, "organizationConnectionsResource", &auth0.OrganizationConnectionsArgs{
    	EnabledConnections: auth0.OrganizationConnectionsEnabledConnectionArray{
    		&auth0.OrganizationConnectionsEnabledConnectionArgs{
    			ConnectionId:            pulumi.String("string"),
    			AssignMembershipOnLogin: pulumi.Bool(false),
    		},
    	},
    	OrganizationId: pulumi.String("string"),
    })
    
    var organizationConnectionsResource = new OrganizationConnections("organizationConnectionsResource", OrganizationConnectionsArgs.builder()        
        .enabledConnections(OrganizationConnectionsEnabledConnectionArgs.builder()
            .connectionId("string")
            .assignMembershipOnLogin(false)
            .build())
        .organizationId("string")
        .build());
    
    organization_connections_resource = auth0.OrganizationConnections("organizationConnectionsResource",
        enabled_connections=[auth0.OrganizationConnectionsEnabledConnectionArgs(
            connection_id="string",
            assign_membership_on_login=False,
        )],
        organization_id="string")
    
    const organizationConnectionsResource = new auth0.OrganizationConnections("organizationConnectionsResource", {
        enabledConnections: [{
            connectionId: "string",
            assignMembershipOnLogin: false,
        }],
        organizationId: "string",
    });
    
    type: auth0:OrganizationConnections
    properties:
        enabledConnections:
            - assignMembershipOnLogin: false
              connectionId: string
        organizationId: string
    

    OrganizationConnections Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The OrganizationConnections resource accepts the following input properties:

    EnabledConnections List<OrganizationConnectionsEnabledConnection>
    Connections that are enabled for the organization.
    OrganizationId string
    ID of the organization on which to enable the connections.
    EnabledConnections []OrganizationConnectionsEnabledConnectionArgs
    Connections that are enabled for the organization.
    OrganizationId string
    ID of the organization on which to enable the connections.
    enabledConnections List<OrganizationConnectionsEnabledConnection>
    Connections that are enabled for the organization.
    organizationId String
    ID of the organization on which to enable the connections.
    enabledConnections OrganizationConnectionsEnabledConnection[]
    Connections that are enabled for the organization.
    organizationId string
    ID of the organization on which to enable the connections.
    enabled_connections Sequence[OrganizationConnectionsEnabledConnectionArgs]
    Connections that are enabled for the organization.
    organization_id str
    ID of the organization on which to enable the connections.
    enabledConnections List<Property Map>
    Connections that are enabled for the organization.
    organizationId String
    ID of the organization on which to enable the connections.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the OrganizationConnections resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing OrganizationConnections Resource

    Get an existing OrganizationConnections resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: OrganizationConnectionsState, opts?: CustomResourceOptions): OrganizationConnections
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            enabled_connections: Optional[Sequence[OrganizationConnectionsEnabledConnectionArgs]] = None,
            organization_id: Optional[str] = None) -> OrganizationConnections
    func GetOrganizationConnections(ctx *Context, name string, id IDInput, state *OrganizationConnectionsState, opts ...ResourceOption) (*OrganizationConnections, error)
    public static OrganizationConnections Get(string name, Input<string> id, OrganizationConnectionsState? state, CustomResourceOptions? opts = null)
    public static OrganizationConnections get(String name, Output<String> id, OrganizationConnectionsState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    EnabledConnections List<OrganizationConnectionsEnabledConnection>
    Connections that are enabled for the organization.
    OrganizationId string
    ID of the organization on which to enable the connections.
    EnabledConnections []OrganizationConnectionsEnabledConnectionArgs
    Connections that are enabled for the organization.
    OrganizationId string
    ID of the organization on which to enable the connections.
    enabledConnections List<OrganizationConnectionsEnabledConnection>
    Connections that are enabled for the organization.
    organizationId String
    ID of the organization on which to enable the connections.
    enabledConnections OrganizationConnectionsEnabledConnection[]
    Connections that are enabled for the organization.
    organizationId string
    ID of the organization on which to enable the connections.
    enabled_connections Sequence[OrganizationConnectionsEnabledConnectionArgs]
    Connections that are enabled for the organization.
    organization_id str
    ID of the organization on which to enable the connections.
    enabledConnections List<Property Map>
    Connections that are enabled for the organization.
    organizationId String
    ID of the organization on which to enable the connections.

    Supporting Types

    OrganizationConnectionsEnabledConnection, OrganizationConnectionsEnabledConnectionArgs

    ConnectionId string
    The ID of the connection to enable for the organization.
    AssignMembershipOnLogin bool
    When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.
    ConnectionId string
    The ID of the connection to enable for the organization.
    AssignMembershipOnLogin bool
    When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.
    connectionId String
    The ID of the connection to enable for the organization.
    assignMembershipOnLogin Boolean
    When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.
    connectionId string
    The ID of the connection to enable for the organization.
    assignMembershipOnLogin boolean
    When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.
    connection_id str
    The ID of the connection to enable for the organization.
    assign_membership_on_login bool
    When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.
    connectionId String
    The ID of the connection to enable for the organization.
    assignMembershipOnLogin Boolean
    When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

    Import

    This resource can be imported by specifying the organization ID.

    Example:

    $ pulumi import auth0:index/organizationConnections:OrganizationConnections my_org_conns "org_XXXXX"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Auth0 pulumi/pulumi-auth0
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the auth0 Terraform Provider.
    auth0 logo
    Auth0 v3.3.1 published on Thursday, Mar 14, 2024 by Pulumi