1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. apigateway
  5. getLogConfigs
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.apigateway.getLogConfigs

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 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);
Copy
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)
Copy
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
	})
}
Copy
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),
    };
});
Copy
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()));
    }
}
Copy
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}
Copy

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>
Copy
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]
Copy
func GetLogConfigs(ctx *Context, args *GetLogConfigsArgs, opts ...InvokeOption) (*GetLogConfigsResult, error)
func GetLogConfigsOutput(ctx *Context, args *GetLogConfigsOutputArgs, opts ...InvokeOption) GetLogConfigsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetLogConfigsResult> getLogConfigs(GetLogConfigsArgs args, InvokeOptions options)
public static Output<GetLogConfigsResult> getLogConfigs(GetLogConfigsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:apigateway/getLogConfigs:getLogConfigs
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids Changes to this property will trigger replacement. List<string>
A list of Log Config IDs.
LogType Changes to this property will trigger replacement. string
The type the of log. Valid values: PROVIDER.
OutputFile string
File name where to save data source results (after running pulumi preview).
Ids Changes to this property will trigger replacement. []string
A list of Log Config IDs.
LogType Changes to this property will trigger replacement. string
The type the of log. Valid values: PROVIDER.
OutputFile string
File name where to save data source results (after running pulumi preview).
ids Changes to this property will trigger replacement. List<String>
A list of Log Config IDs.
logType Changes to this property will trigger replacement. String
The type the of log. Valid values: PROVIDER.
outputFile String
File name where to save data source results (after running pulumi preview).
ids Changes to this property will trigger replacement. string[]
A list of Log Config IDs.
logType Changes to this property will trigger replacement. string
The type the of log. Valid values: PROVIDER.
outputFile string
File name where to save data source results (after running pulumi preview).
ids Changes to this property will trigger replacement. Sequence[str]
A list of Log Config IDs.
log_type Changes to this property will trigger replacement. str
The type the of log. Valid values: PROVIDER.
output_file str
File name where to save data source results (after running pulumi preview).
ids Changes to this property will trigger replacement. List<String>
A list of Log Config IDs.
logType Changes to this property will trigger replacement. String
The type the of log. Valid values: PROVIDER.
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 This property is required. string
The ID of the Log Config.
LogType This property is required. string
The type the of log.
RegionId This property is required. string
The region ID of the Log Config.
SlsLogStore This property is required. string
The name of the Log Store.
SlsProject This property is required. string
The name of the Project.
Id This property is required. string
The ID of the Log Config.
LogType This property is required. string
The type the of log.
RegionId This property is required. string
The region ID of the Log Config.
SlsLogStore This property is required. string
The name of the Log Store.
SlsProject This property is required. string
The name of the Project.
id This property is required. String
The ID of the Log Config.
logType This property is required. String
The type the of log.
regionId This property is required. String
The region ID of the Log Config.
slsLogStore This property is required. String
The name of the Log Store.
slsProject This property is required. String
The name of the Project.
id This property is required. string
The ID of the Log Config.
logType This property is required. string
The type the of log.
regionId This property is required. string
The region ID of the Log Config.
slsLogStore This property is required. string
The name of the Log Store.
slsProject This property is required. string
The name of the Project.
id This property is required. str
The ID of the Log Config.
log_type This property is required. str
The type the of log.
region_id This property is required. str
The region ID of the Log Config.
sls_log_store This property is required. str
The name of the Log Store.
sls_project This property is required. str
The name of the Project.
id This property is required. String
The ID of the Log Config.
logType This property is required. String
The type the of log.
regionId This property is required. String
The region ID of the Log Config.
slsLogStore This property is required. String
The name of the Log Store.
slsProject This property is required. 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.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi