1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. apigateway
  5. getLogConfigs
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

alicloud.apigateway.getLogConfigs

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

    This data source provides the Api Gateway Log Configs of the current Alibaba Cloud user.

    NOTE: Available in v1.185.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.apigateway.getLogConfigs({
        ids: ["example_id"],
    });
    export const apiGatewayLogConfigId1 = ids.then(ids => ids.configs?.[0]?.id);
    const logType = alicloud.apigateway.getLogConfigs({
        logType: "PROVIDER",
    });
    export const apiGatewayLogConfigId2 = logType.then(logType => logType.configs?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.apigateway.get_log_configs(ids=["example_id"])
    pulumi.export("apiGatewayLogConfigId1", ids.configs[0].id)
    log_type = alicloud.apigateway.get_log_configs(log_type="PROVIDER")
    pulumi.export("apiGatewayLogConfigId2", log_type.configs[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/apigateway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := apigateway.GetLogConfigs(ctx, &apigateway.GetLogConfigsArgs{
    			Ids: []string{
    				"example_id",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("apiGatewayLogConfigId1", ids.Configs[0].Id)
    		logType, err := apigateway.GetLogConfigs(ctx, &apigateway.GetLogConfigsArgs{
    			LogType: pulumi.StringRef("PROVIDER"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("apiGatewayLogConfigId2", logType.Configs[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.ApiGateway.GetLogConfigs.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
        });
    
        var logType = AliCloud.ApiGateway.GetLogConfigs.Invoke(new()
        {
            LogType = "PROVIDER",
        });
    
        return new Dictionary<string, object?>
        {
            ["apiGatewayLogConfigId1"] = ids.Apply(getLogConfigsResult => getLogConfigsResult.Configs[0]?.Id),
            ["apiGatewayLogConfigId2"] = logType.Apply(getLogConfigsResult => getLogConfigsResult.Configs[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.apigateway.ApigatewayFunctions;
    import com.pulumi.alicloud.apigateway.inputs.GetLogConfigsArgs;
    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 ids = ApigatewayFunctions.getLogConfigs(GetLogConfigsArgs.builder()
                .ids("example_id")
                .build());
    
            ctx.export("apiGatewayLogConfigId1", ids.applyValue(getLogConfigsResult -> getLogConfigsResult.configs()[0].id()));
            final var logType = ApigatewayFunctions.getLogConfigs(GetLogConfigsArgs.builder()
                .logType("PROVIDER")
                .build());
    
            ctx.export("apiGatewayLogConfigId2", logType.applyValue(getLogConfigsResult -> getLogConfigsResult.configs()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:apigateway:getLogConfigs
          Arguments:
            ids:
              - example_id
      logType:
        fn::invoke:
          Function: alicloud:apigateway:getLogConfigs
          Arguments:
            logType: PROVIDER
    outputs:
      apiGatewayLogConfigId1: ${ids.configs[0].id}
      apiGatewayLogConfigId2: ${logType.configs[0].id}
    

    Using getLogConfigs

    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 getLogConfigs(args: GetLogConfigsArgs, opts?: InvokeOptions): Promise<GetLogConfigsResult>
    function getLogConfigsOutput(args: GetLogConfigsOutputArgs, opts?: InvokeOptions): Output<GetLogConfigsResult>
    def get_log_configs(ids: Optional[Sequence[str]] = None,
                        log_type: Optional[str] = None,
                        output_file: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetLogConfigsResult
    def get_log_configs_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                        log_type: Optional[pulumi.Input[str]] = None,
                        output_file: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetLogConfigsResult]
    func GetLogConfigs(ctx *Context, args *GetLogConfigsArgs, opts ...InvokeOption) (*GetLogConfigsResult, error)
    func GetLogConfigsOutput(ctx *Context, args *GetLogConfigsOutputArgs, opts ...InvokeOption) GetLogConfigsResultOutput

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

    public static class GetLogConfigs 
    {
        public static Task<GetLogConfigsResult> InvokeAsync(GetLogConfigsArgs args, InvokeOptions? opts = null)
        public static Output<GetLogConfigsResult> Invoke(GetLogConfigsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLogConfigsResult> getLogConfigs(GetLogConfigsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:apigateway/getLogConfigs:getLogConfigs
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Log Config IDs.
    LogType string
    The type the of log.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Ids []string
    A list of Log Config IDs.
    LogType string
    The type the of log.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Log Config IDs.
    logType String
    The type the of log.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ids string[]
    A list of Log Config IDs.
    logType string
    The type the of log.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ids Sequence[str]
    A list of Log Config IDs.
    log_type str
    The type the of log.
    output_file str
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Log Config IDs.
    logType String
    The type the of log.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getLogConfigs Result

    The following output properties are available:

    Configs List<Pulumi.AliCloud.ApiGateway.Outputs.GetLogConfigsConfig>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    LogType string
    OutputFile string
    Configs []GetLogConfigsConfig
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    LogType string
    OutputFile string
    configs List<GetLogConfigsConfig>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    logType String
    outputFile String
    configs GetLogConfigsConfig[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    logType string
    outputFile string
    configs Sequence[GetLogConfigsConfig]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    log_type str
    output_file str
    configs List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    logType String
    outputFile String

    Supporting Types

    GetLogConfigsConfig

    Id string
    The ID of the Log Config.
    LogType string
    The type the of log.
    RegionId string
    The region ID of the Log Config.
    SlsLogStore string
    The name of the Log Store.
    SlsProject string
    The name of the Project.
    Id string
    The ID of the Log Config.
    LogType string
    The type the of log.
    RegionId string
    The region ID of the Log Config.
    SlsLogStore string
    The name of the Log Store.
    SlsProject string
    The name of the Project.
    id String
    The ID of the Log Config.
    logType String
    The type the of log.
    regionId String
    The region ID of the Log Config.
    slsLogStore String
    The name of the Log Store.
    slsProject String
    The name of the Project.
    id string
    The ID of the Log Config.
    logType string
    The type the of log.
    regionId string
    The region ID of the Log Config.
    slsLogStore string
    The name of the Log Store.
    slsProject string
    The name of the Project.
    id str
    The ID of the Log Config.
    log_type str
    The type the of log.
    region_id str
    The region ID of the Log Config.
    sls_log_store str
    The name of the Log Store.
    sls_project str
    The name of the Project.
    id String
    The ID of the Log Config.
    logType String
    The type the of log.
    regionId String
    The region ID of the Log Config.
    slsLogStore String
    The name of the Log Store.
    slsProject String
    The name of the Project.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi