1. Packages
  2. Azure Active Directory (Azure AD)
  3. API Docs
  4. getNamedLocation
Azure Active Directory (Azure AD) v6.0.1 published on Monday, Oct 14, 2024 by Pulumi

azuread.getNamedLocation

Explore with Pulumi AI

azuread logo
Azure Active Directory (Azure AD) v6.0.1 published on Monday, Oct 14, 2024 by Pulumi

    Gets information about a Named Location within Azure Active Directory.

    API Permissions

    The following API permissions are required in order to use this data source.

    When authenticated with a service principal, this resource requires the following application roles: Policy.Read.All

    When authenticated with a user principal, this resource requires one of the following directory roles: Conditional Access Administrator or Global Reader

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuread from "@pulumi/azuread";
    
    const example = azuread.getNamedLocation({
        displayName: "My Named Location",
    });
    
    import pulumi
    import pulumi_azuread as azuread
    
    example = azuread.get_named_location(display_name="My Named Location")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuread/sdk/v6/go/azuread"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := azuread.LookupNamedLocation(ctx, &azuread.LookupNamedLocationArgs{
    			DisplayName: "My Named Location",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureAD = Pulumi.AzureAD;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AzureAD.GetNamedLocation.Invoke(new()
        {
            DisplayName = "My Named Location",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuread.AzureadFunctions;
    import com.pulumi.azuread.inputs.GetNamedLocationArgs;
    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 = AzureadFunctions.getNamedLocation(GetNamedLocationArgs.builder()
                .displayName("My Named Location")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azuread:getNamedLocation
          Arguments:
            displayName: My Named Location
    

    Attributes Reference

    The following attributes are exported:

    • country - A country block as documented below, which describes a country-based named location.
    • id - The ID of the named location.
    • ip - An ip block as documented below, which describes an IP-based named location.

    country block exports the following:

    • countries_and_regions - List of countries and/or regions in two-letter format specified by ISO 3166-2.
    • include_unknown_countries_and_regions - Whether IP addresses that don’t map to a country or region are included in the named location.

    ip block exports the following:

    • ip_ranges - List of IP address ranges in IPv4 CIDR format (e.g. 1.2.3.4/32) or any allowable IPv6 format from IETF RFC596.
    • trusted - Whether the named location is trusted.

    Using getNamedLocation

    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 getNamedLocation(args: GetNamedLocationArgs, opts?: InvokeOptions): Promise<GetNamedLocationResult>
    function getNamedLocationOutput(args: GetNamedLocationOutputArgs, opts?: InvokeOptions): Output<GetNamedLocationResult>
    def get_named_location(display_name: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetNamedLocationResult
    def get_named_location_output(display_name: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetNamedLocationResult]
    func LookupNamedLocation(ctx *Context, args *LookupNamedLocationArgs, opts ...InvokeOption) (*LookupNamedLocationResult, error)
    func LookupNamedLocationOutput(ctx *Context, args *LookupNamedLocationOutputArgs, opts ...InvokeOption) LookupNamedLocationResultOutput

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

    public static class GetNamedLocation 
    {
        public static Task<GetNamedLocationResult> InvokeAsync(GetNamedLocationArgs args, InvokeOptions? opts = null)
        public static Output<GetNamedLocationResult> Invoke(GetNamedLocationInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNamedLocationResult> getNamedLocation(GetNamedLocationArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azuread:index/getNamedLocation:getNamedLocation
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DisplayName string
    Specifies the display named of the named location to look up.
    DisplayName string
    Specifies the display named of the named location to look up.
    displayName String
    Specifies the display named of the named location to look up.
    displayName string
    Specifies the display named of the named location to look up.
    display_name str
    Specifies the display named of the named location to look up.
    displayName String
    Specifies the display named of the named location to look up.

    getNamedLocation Result

    The following output properties are available:

    Countries []GetNamedLocationCountry
    DisplayName string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ips []GetNamedLocationIp
    countries List<GetNamedLocationCountry>
    displayName String
    id String
    The provider-assigned unique ID for this managed resource.
    ips List<GetNamedLocationIp>
    countries GetNamedLocationCountry[]
    displayName string
    id string
    The provider-assigned unique ID for this managed resource.
    ips GetNamedLocationIp[]
    countries Sequence[GetNamedLocationCountry]
    display_name str
    id str
    The provider-assigned unique ID for this managed resource.
    ips Sequence[GetNamedLocationIp]
    countries List<Property Map>
    displayName String
    id String
    The provider-assigned unique ID for this managed resource.
    ips List<Property Map>

    Supporting Types

    GetNamedLocationCountry

    GetNamedLocationIp

    IpRanges List<string>
    Trusted bool
    IpRanges []string
    Trusted bool
    ipRanges List<String>
    trusted Boolean
    ipRanges string[]
    trusted boolean
    ip_ranges Sequence[str]
    trusted bool
    ipRanges List<String>
    trusted Boolean

    Package Details

    Repository
    Azure Active Directory (Azure AD) pulumi/pulumi-azuread
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azuread Terraform Provider.
    azuread logo
    Azure Active Directory (Azure AD) v6.0.1 published on Monday, Oct 14, 2024 by Pulumi