Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi
This data source provides Apig Policy available to the user.What is Policy
NOTE: Available since v1.292.0.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
// The ID of an existing APIG gateway
const gatewayId = config.require("gatewayId");
const _default = alicloud.apig.getPolicies({
gatewayId: gatewayId,
});
export const firstPolicyId = _default.then(_default => _default.policies?.[0]?.policyId);
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
# The ID of an existing APIG gateway
gateway_id = config.require("gatewayId")
default = alicloud.apig.get_policies(gateway_id=gateway_id)
pulumi.export("firstPolicyId", default.policies[0].policy_id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/apig"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
// The ID of an existing APIG gateway
gatewayId := cfg.Require("gatewayId")
_default, err := apig.GetPolicies(ctx, &apig.GetPoliciesArgs{
GatewayId: pulumi.StringRef(gatewayId),
}, nil)
if err != nil {
return err
}
ctx.Export("firstPolicyId", _default.Policies[0].PolicyId)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
// The ID of an existing APIG gateway
var gatewayId = config.Require("gatewayId");
var @default = AliCloud.Apig.GetPolicies.Invoke(new()
{
GatewayId = gatewayId,
});
return new Dictionary<string, object?>
{
["firstPolicyId"] = @default.Apply(@default => @default.Apply(getPoliciesResult => getPoliciesResult.Policies[0]?.PolicyId)),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.apig.ApigFunctions;
import com.pulumi.alicloud.apig.inputs.GetPoliciesArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 config = ctx.config();
final var gatewayId = config.require("gatewayId");
final var default = ApigFunctions.getPolicies(GetPoliciesArgs.builder()
.gatewayId(gatewayId)
.build());
ctx.export("firstPolicyId", default_.policies()[0].policyId());
}
}
configuration:
gatewayId:
type: string
variables:
default:
fn::invoke:
function: alicloud:apig:getPolicies
arguments:
gatewayId: ${gatewayId}
outputs:
firstPolicyId: ${default.policies[0].policyId}
pulumi {
required_providers {
alicloud = {
source = "pulumi/alicloud"
}
}
}
data "alicloud_apig_getpolicies" "default" {
gateway_id = var.gatewayId
}
variable "gatewayId" {
type = string
description = "The ID of an existing APIG gateway"
}
output "firstPolicyId" {
value = data.alicloud_apig_getpolicies.default.policies[0].policy_id
}
Using getPolicies
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 getPolicies(args: GetPoliciesArgs, opts?: InvokeOptions): Promise<GetPoliciesResult>
function getPoliciesOutput(args: GetPoliciesOutputArgs, opts?: InvokeOutputOptions): Output<GetPoliciesResult>def get_policies(attach_resource_ids: Optional[str] = None,
attach_resource_type: Optional[str] = None,
enable_details: Optional[bool] = None,
environment_id: Optional[str] = None,
gateway_id: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPoliciesResult
def get_policies_output(attach_resource_ids: pulumi.Input[Optional[str]] = None,
attach_resource_type: pulumi.Input[Optional[str]] = None,
enable_details: pulumi.Input[Optional[bool]] = None,
environment_id: pulumi.Input[Optional[str]] = None,
gateway_id: pulumi.Input[Optional[str]] = None,
ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
name_regex: pulumi.Input[Optional[str]] = None,
output_file: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetPoliciesResult]func GetPolicies(ctx *Context, args *GetPoliciesArgs, opts ...InvokeOption) (*GetPoliciesResult, error)
func GetPoliciesOutput(ctx *Context, args *GetPoliciesOutputArgs, opts ...InvokeOption) GetPoliciesResultOutput> Note: This function is named GetPolicies in the Go SDK.
public static class GetPolicies
{
public static Task<GetPoliciesResult> InvokeAsync(GetPoliciesArgs args, InvokeOptions? opts = null)
public static Output<GetPoliciesResult> Invoke(GetPoliciesInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetPoliciesResult> Invoke(GetPoliciesInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetPoliciesResult> getPolicies(GetPoliciesArgs args, InvokeOptions options)
public static Output<GetPoliciesResult> getPolicies(GetPoliciesArgs args, InvokeOptions options)
public static Output<GetPoliciesResult> getPolicies(GetPoliciesArgs args, InvokeOutputOptions options)
fn::invoke:
function: alicloud:apig/getPolicies:getPolicies
arguments:
# arguments dictionarydata "alicloud_apig_get_policies" "name" {
# arguments
}The following arguments are supported:
- Attach
Resource stringIds - The ID of the attach point resource to filter policies by.
- Attach
Resource stringType - Policies support mount point types. Valid values:
HttpApi,Operation,GatewayRoute,GatewayService,GatewayServicePort,Domain,Gateway. - Enable
Details bool - Default to
false. Set it totrueto output more details about resource attributes that belong to this policy. - Environment
Id string - Environment id.
- Gateway
Id string - Gateway id.
- Ids List<string>
- A list of Policy IDs.
- Name
Regex string - A regex string to filter results by policy name.
- Output
File string - File name where to save data source results (after running
pulumi preview).
- Attach
Resource stringIds - The ID of the attach point resource to filter policies by.
- Attach
Resource stringType - Policies support mount point types. Valid values:
HttpApi,Operation,GatewayRoute,GatewayService,GatewayServicePort,Domain,Gateway. - Enable
Details bool - Default to
false. Set it totrueto output more details about resource attributes that belong to this policy. - Environment
Id string - Environment id.
- Gateway
Id string - Gateway id.
- Ids []string
- A list of Policy IDs.
- Name
Regex string - A regex string to filter results by policy name.
- Output
File string - File name where to save data source results (after running
pulumi preview).
- attach_
resource_ stringids - The ID of the attach point resource to filter policies by.
- attach_
resource_ stringtype - Policies support mount point types. Valid values:
HttpApi,Operation,GatewayRoute,GatewayService,GatewayServicePort,Domain,Gateway. - enable_
details bool - Default to
false. Set it totrueto output more details about resource attributes that belong to this policy. - environment_
id string - Environment id.
- gateway_
id string - Gateway id.
- ids list(string)
- A list of Policy IDs.
- name_
regex string - A regex string to filter results by policy name.
- output_
file string - File name where to save data source results (after running
pulumi preview).
- attach
Resource StringIds - The ID of the attach point resource to filter policies by.
- attach
Resource StringType - Policies support mount point types. Valid values:
HttpApi,Operation,GatewayRoute,GatewayService,GatewayServicePort,Domain,Gateway. - enable
Details Boolean - Default to
false. Set it totrueto output more details about resource attributes that belong to this policy. - environment
Id String - Environment id.
- gateway
Id String - Gateway id.
- ids List<String>
- A list of Policy IDs.
- name
Regex String - A regex string to filter results by policy name.
- output
File String - File name where to save data source results (after running
pulumi preview).
- attach
Resource stringIds - The ID of the attach point resource to filter policies by.
- attach
Resource stringType - Policies support mount point types. Valid values:
HttpApi,Operation,GatewayRoute,GatewayService,GatewayServicePort,Domain,Gateway. - enable
Details boolean - Default to
false. Set it totrueto output more details about resource attributes that belong to this policy. - environment
Id string - Environment id.
- gateway
Id string - Gateway id.
- ids string[]
- A list of Policy IDs.
- name
Regex string - A regex string to filter results by policy name.
- output
File string - File name where to save data source results (after running
pulumi preview).
- attach_
resource_ strids - The ID of the attach point resource to filter policies by.
- attach_
resource_ strtype - Policies support mount point types. Valid values:
HttpApi,Operation,GatewayRoute,GatewayService,GatewayServicePort,Domain,Gateway. - enable_
details bool - Default to
false. Set it totrueto output more details about resource attributes that belong to this policy. - environment_
id str - Environment id.
- gateway_
id str - Gateway id.
- ids Sequence[str]
- A list of Policy IDs.
- name_
regex str - A regex string to filter results by policy name.
- output_
file str - File name where to save data source results (after running
pulumi preview).
- attach
Resource StringIds - The ID of the attach point resource to filter policies by.
- attach
Resource StringType - Policies support mount point types. Valid values:
HttpApi,Operation,GatewayRoute,GatewayService,GatewayServicePort,Domain,Gateway. - enable
Details Boolean - Default to
false. Set it totrueto output more details about resource attributes that belong to this policy. - environment
Id String - Environment id.
- gateway
Id String - Gateway id.
- ids List<String>
- A list of Policy IDs.
- name
Regex String - A regex string to filter results by policy name.
- output
File String - File name where to save data source results (after running
pulumi preview).
getPolicies Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- A list of Policy names.
- Policies
List<Pulumi.
Ali Cloud. Apig. Outputs. Get Policies Policy> - A list of Policy Entries. Each element contains the following attributes:
- Attach
Resource stringIds - The Mount point id list.
- Attach
Resource stringType - The mount point type of the policy.
- Enable
Details bool - Environment
Id string - Environment id.
- Gateway
Id string - Gateway id.
- Name
Regex string - Output
File string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- A list of Policy names.
- Policies
[]Get
Policies Policy - A list of Policy Entries. Each element contains the following attributes:
- Attach
Resource stringIds - The Mount point id list.
- Attach
Resource stringType - The mount point type of the policy.
- Enable
Details bool - Environment
Id string - Environment id.
- Gateway
Id string - Gateway id.
- Name
Regex string - Output
File string
- id string
- The provider-assigned unique ID for this managed resource.
- ids list(string)
- names list(string)
- A list of Policy names.
- policies list(object)
- A list of Policy Entries. Each element contains the following attributes:
- attach_
resource_ stringids - The Mount point id list.
- attach_
resource_ stringtype - The mount point type of the policy.
- enable_
details bool - environment_
id string - Environment id.
- gateway_
id string - Gateway id.
- name_
regex string - output_
file string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- A list of Policy names.
- policies
List<Get
Policies Policy> - A list of Policy Entries. Each element contains the following attributes:
- attach
Resource StringIds - The Mount point id list.
- attach
Resource StringType - The mount point type of the policy.
- enable
Details Boolean - environment
Id String - Environment id.
- gateway
Id String - Gateway id.
- name
Regex String - output
File String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- A list of Policy names.
- policies
Get
Policies Policy[] - A list of Policy Entries. Each element contains the following attributes:
- attach
Resource stringIds - The Mount point id list.
- attach
Resource stringType - The mount point type of the policy.
- enable
Details boolean - environment
Id string - Environment id.
- gateway
Id string - Gateway id.
- name
Regex string - output
File string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- A list of Policy names.
- policies
Sequence[Get
Policies Policy] - A list of Policy Entries. Each element contains the following attributes:
- attach_
resource_ strids - The Mount point id list.
- attach_
resource_ strtype - The mount point type of the policy.
- enable_
details bool - environment_
id str - Environment id.
- gateway_
id str - Gateway id.
- name_
regex str - output_
file str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- A list of Policy names.
- policies List<Property Map>
- A list of Policy Entries. Each element contains the following attributes:
- attach
Resource StringIds - The Mount point id list.
- attach
Resource StringType - The mount point type of the policy.
- enable
Details Boolean - environment
Id String - Environment id.
- gateway
Id String - Gateway id.
- name
Regex String - output
File String
Supporting Types
GetPoliciesPolicy
- Attach
Resource List<string>Ids - The ID of the attach point resource to filter policies by.
- Attach
Resource stringType - Policies support mount point types. Valid values:
HttpApi,Operation,GatewayRoute,GatewayService,GatewayServicePort,Domain,Gateway. - Environment
Id string - Environment id.
- Gateway
Id string - Gateway id.
- Id string
- The ID of the Policy.
- Policy
Attachment stringId - Policy attachment id.
- Policy
Class stringId - Policy class id.
- Policy
Class stringName - Policy class name.
- Policy
Config string - Policy configuration.
- Policy
Id string - The first ID of the resource.
- Policy
Name string - Policy name.
- Attach
Resource []stringIds - The ID of the attach point resource to filter policies by.
- Attach
Resource stringType - Policies support mount point types. Valid values:
HttpApi,Operation,GatewayRoute,GatewayService,GatewayServicePort,Domain,Gateway. - Environment
Id string - Environment id.
- Gateway
Id string - Gateway id.
- Id string
- The ID of the Policy.
- Policy
Attachment stringId - Policy attachment id.
- Policy
Class stringId - Policy class id.
- Policy
Class stringName - Policy class name.
- Policy
Config string - Policy configuration.
- Policy
Id string - The first ID of the resource.
- Policy
Name string - Policy name.
- attach_
resource_ list(string)ids - The ID of the attach point resource to filter policies by.
- attach_
resource_ stringtype - Policies support mount point types. Valid values:
HttpApi,Operation,GatewayRoute,GatewayService,GatewayServicePort,Domain,Gateway. - environment_
id string - Environment id.
- gateway_
id string - Gateway id.
- id string
- The ID of the Policy.
- policy_
attachment_ stringid - Policy attachment id.
- policy_
class_ stringid - Policy class id.
- policy_
class_ stringname - Policy class name.
- policy_
config string - Policy configuration.
- policy_
id string - The first ID of the resource.
- policy_
name string - Policy name.
- attach
Resource List<String>Ids - The ID of the attach point resource to filter policies by.
- attach
Resource StringType - Policies support mount point types. Valid values:
HttpApi,Operation,GatewayRoute,GatewayService,GatewayServicePort,Domain,Gateway. - environment
Id String - Environment id.
- gateway
Id String - Gateway id.
- id String
- The ID of the Policy.
- policy
Attachment StringId - Policy attachment id.
- policy
Class StringId - Policy class id.
- policy
Class StringName - Policy class name.
- policy
Config String - Policy configuration.
- policy
Id String - The first ID of the resource.
- policy
Name String - Policy name.
- attach
Resource string[]Ids - The ID of the attach point resource to filter policies by.
- attach
Resource stringType - Policies support mount point types. Valid values:
HttpApi,Operation,GatewayRoute,GatewayService,GatewayServicePort,Domain,Gateway. - environment
Id string - Environment id.
- gateway
Id string - Gateway id.
- id string
- The ID of the Policy.
- policy
Attachment stringId - Policy attachment id.
- policy
Class stringId - Policy class id.
- policy
Class stringName - Policy class name.
- policy
Config string - Policy configuration.
- policy
Id string - The first ID of the resource.
- policy
Name string - Policy name.
- attach_
resource_ Sequence[str]ids - The ID of the attach point resource to filter policies by.
- attach_
resource_ strtype - Policies support mount point types. Valid values:
HttpApi,Operation,GatewayRoute,GatewayService,GatewayServicePort,Domain,Gateway. - environment_
id str - Environment id.
- gateway_
id str - Gateway id.
- id str
- The ID of the Policy.
- policy_
attachment_ strid - Policy attachment id.
- policy_
class_ strid - Policy class id.
- policy_
class_ strname - Policy class name.
- policy_
config str - Policy configuration.
- policy_
id str - The first ID of the resource.
- policy_
name str - Policy name.
- attach
Resource List<String>Ids - The ID of the attach point resource to filter policies by.
- attach
Resource StringType - Policies support mount point types. Valid values:
HttpApi,Operation,GatewayRoute,GatewayService,GatewayServicePort,Domain,Gateway. - environment
Id String - Environment id.
- gateway
Id String - Gateway id.
- id String
- The ID of the Policy.
- policy
Attachment StringId - Policy attachment id.
- policy
Class StringId - Policy class id.
- policy
Class StringName - Policy class name.
- policy
Config String - Policy configuration.
- policy
Id String - The first ID of the resource.
- policy
Name String - Policy name.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi