published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi
Provides a APIG Policy resource.
For information about APIG Policy and how to use it, see What is Policy.
NOTE: Available since v1.292.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = new alicloud.vpc.Network("default", {
vpcName: `${name}-vpc`,
cidrBlock: "192.168.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
vswitchName: `${name}-vsw`,
vpcId: _default.id,
zoneId: "cn-hangzhou-b",
cidrBlock: "192.168.15.0/24",
});
const defaultGateway = new alicloud.apig.Gateway("default", {
gatewayName: `${name}-gw`,
gatewayType: "API",
paymentType: "PayAsYouGo",
spec: "apigw.small.x1",
networkAccessConfig: {
type: "Intranet",
},
vpc: {
vpcId: _default.id,
},
vswitch: {
vswitchId: defaultSwitch.id,
},
zoneConfig: {
selectOption: "Auto",
},
});
const defaultService = new alicloud.apig.Service("default", {
serviceName: `${name}-svc`,
sourceType: "DNS",
gatewayId: defaultGateway.id,
addresses: ["httpbin.org:8080"],
});
const defaultPolicy = new alicloud.apig.Policy("default", {
policyName: name,
policyClassName: "ServiceTls",
policyConfig: "{\"mode\":\"SIMPLE\",\"sni\":\"aaaa\",\"enable\":true}",
gatewayId: defaultGateway.id,
environmentId: defaultGateway.environments[0].environmentId,
attachResourceType: "GatewayService",
attachResourceIds: [defaultService.id],
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.vpc.Network("default",
vpc_name=f"{name}-vpc",
cidr_block="192.168.0.0/16")
default_switch = alicloud.vpc.Switch("default",
vswitch_name=f"{name}-vsw",
vpc_id=default.id,
zone_id="cn-hangzhou-b",
cidr_block="192.168.15.0/24")
default_gateway = alicloud.apig.Gateway("default",
gateway_name=f"{name}-gw",
gateway_type="API",
payment_type="PayAsYouGo",
spec="apigw.small.x1",
network_access_config={
"type": "Intranet",
},
vpc={
"vpc_id": default.id,
},
vswitch={
"vswitch_id": default_switch.id,
},
zone_config={
"select_option": "Auto",
})
default_service = alicloud.apig.Service("default",
service_name=f"{name}-svc",
source_type="DNS",
gateway_id=default_gateway.id,
addresses=["httpbin.org:8080"])
default_policy = alicloud.apig.Policy("default",
policy_name=name,
policy_class_name="ServiceTls",
policy_config="{\"mode\":\"SIMPLE\",\"sni\":\"aaaa\",\"enable\":true}",
gateway_id=default_gateway.id,
environment_id=default_gateway.environments[0].environment_id,
attach_resource_type="GatewayService",
attach_resource_ids=[default_service.id])
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/apig"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"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, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_default, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
VpcName: pulumi.Sprintf("%v-vpc", name),
CidrBlock: pulumi.String("192.168.0.0/16"),
})
if err != nil {
return err
}
defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
VswitchName: pulumi.Sprintf("%v-vsw", name),
VpcId: _default.ID().ToIDOutput().ToStringOutput(),
ZoneId: pulumi.String("cn-hangzhou-b"),
CidrBlock: pulumi.String("192.168.15.0/24"),
})
if err != nil {
return err
}
defaultGateway, err := apig.NewGateway(ctx, "default", &apig.GatewayArgs{
GatewayName: pulumi.Sprintf("%v-gw", name),
GatewayType: pulumi.String("API"),
PaymentType: pulumi.String("PayAsYouGo"),
Spec: pulumi.String("apigw.small.x1"),
NetworkAccessConfig: &apig.GatewayNetworkAccessConfigArgs{
Type: pulumi.String("Intranet"),
},
Vpc: &apig.GatewayVpcArgs{
VpcId: _default.ID().ToIDOutput().ToStringOutput(),
},
Vswitch: &apig.GatewayVswitchArgs{
VswitchId: defaultSwitch.ID().ToIDOutput().ToStringOutput(),
},
ZoneConfig: &apig.GatewayZoneConfigArgs{
SelectOption: pulumi.String("Auto"),
},
})
if err != nil {
return err
}
defaultService, err := apig.NewService(ctx, "default", &apig.ServiceArgs{
ServiceName: pulumi.Sprintf("%v-svc", name),
SourceType: pulumi.String("DNS"),
GatewayId: defaultGateway.ID().ToIDOutput().ToStringOutput(),
Addresses: pulumi.StringArray{
pulumi.String("httpbin.org:8080"),
},
})
if err != nil {
return err
}
_, err = apig.NewPolicy(ctx, "default", &apig.PolicyArgs{
PolicyName: pulumi.String(name),
PolicyClassName: pulumi.String("ServiceTls"),
PolicyConfig: pulumi.String("{\"mode\":\"SIMPLE\",\"sni\":\"aaaa\",\"enable\":true}"),
GatewayId: defaultGateway.ID().ToIDOutput().ToStringOutput(),
EnvironmentId: defaultGateway.Environments.ApplyT(func(environments []apig.GatewayEnvironment) (*string, error) {
return environments[0].EnvironmentId, nil
}).(pulumi.StringPtrOutput),
AttachResourceType: pulumi.String("GatewayService"),
AttachResourceIds: pulumi.StringArray{
defaultService.ID().ToIDOutput().ToStringOutput(),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = new AliCloud.Vpc.Network("default", new()
{
VpcName = $"{name}-vpc",
CidrBlock = "192.168.0.0/16",
});
var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
{
VswitchName = $"{name}-vsw",
VpcId = @default.Id,
ZoneId = "cn-hangzhou-b",
CidrBlock = "192.168.15.0/24",
});
var defaultGateway = new AliCloud.Apig.Gateway("default", new()
{
GatewayName = $"{name}-gw",
GatewayType = "API",
PaymentType = "PayAsYouGo",
Spec = "apigw.small.x1",
NetworkAccessConfig = new AliCloud.Apig.Inputs.GatewayNetworkAccessConfigArgs
{
Type = "Intranet",
},
Vpc = new AliCloud.Apig.Inputs.GatewayVpcArgs
{
VpcId = @default.Id,
},
Vswitch = new AliCloud.Apig.Inputs.GatewayVswitchArgs
{
VswitchId = defaultSwitch.Id,
},
ZoneConfig = new AliCloud.Apig.Inputs.GatewayZoneConfigArgs
{
SelectOption = "Auto",
},
});
var defaultService = new AliCloud.Apig.Service("default", new()
{
ServiceName = $"{name}-svc",
SourceType = "DNS",
GatewayId = defaultGateway.Id,
Addresses = new[]
{
"httpbin.org:8080",
},
});
var defaultPolicy = new AliCloud.Apig.Policy("default", new()
{
PolicyName = name,
PolicyClassName = "ServiceTls",
PolicyConfig = "{\"mode\":\"SIMPLE\",\"sni\":\"aaaa\",\"enable\":true}",
GatewayId = defaultGateway.Id,
EnvironmentId = defaultGateway.Environments.Apply(environments => environments[0].EnvironmentId),
AttachResourceType = "GatewayService",
AttachResourceIds = new[]
{
defaultService.Id,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.apig.Gateway;
import com.pulumi.alicloud.apig.GatewayArgs;
import com.pulumi.alicloud.apig.inputs.GatewayNetworkAccessConfigArgs;
import com.pulumi.alicloud.apig.inputs.GatewayVpcArgs;
import com.pulumi.alicloud.apig.inputs.GatewayVswitchArgs;
import com.pulumi.alicloud.apig.inputs.GatewayZoneConfigArgs;
import com.pulumi.alicloud.apig.Service;
import com.pulumi.alicloud.apig.ServiceArgs;
import com.pulumi.alicloud.apig.Policy;
import com.pulumi.alicloud.apig.PolicyArgs;
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 name = config.get("name").orElse("terraform-example");
var default_ = new Network("default", NetworkArgs.builder()
.vpcName(String.format("%s-vpc", name))
.cidrBlock("192.168.0.0/16")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName(String.format("%s-vsw", name))
.vpcId(default_.id())
.zoneId("cn-hangzhou-b")
.cidrBlock("192.168.15.0/24")
.build());
var defaultGateway = new Gateway("defaultGateway", GatewayArgs.builder()
.gatewayName(String.format("%s-gw", name))
.gatewayType("API")
.paymentType("PayAsYouGo")
.spec("apigw.small.x1")
.networkAccessConfig(GatewayNetworkAccessConfigArgs.builder()
.type("Intranet")
.build())
.vpc(GatewayVpcArgs.builder()
.vpcId(default_.id())
.build())
.vswitch(GatewayVswitchArgs.builder()
.vswitchId(defaultSwitch.id())
.build())
.zoneConfig(GatewayZoneConfigArgs.builder()
.selectOption("Auto")
.build())
.build());
var defaultService = new Service("defaultService", ServiceArgs.builder()
.serviceName(String.format("%s-svc", name))
.sourceType("DNS")
.gatewayId(defaultGateway.id())
.addresses("httpbin.org:8080")
.build());
var defaultPolicy = new Policy("defaultPolicy", PolicyArgs.builder()
.policyName(name)
.policyClassName("ServiceTls")
.policyConfig("{\"mode\":\"SIMPLE\",\"sni\":\"aaaa\",\"enable\":true}")
.gatewayId(defaultGateway.id())
.environmentId(defaultGateway.environments().applyValue(_environments -> _environments[0].environmentId()))
.attachResourceType("GatewayService")
.attachResourceIds(defaultService.id())
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
default:
type: alicloud:vpc:Network
properties:
vpcName: ${name}-vpc
cidrBlock: 192.168.0.0/16
defaultSwitch:
type: alicloud:vpc:Switch
name: default
properties:
vswitchName: ${name}-vsw
vpcId: ${default.id}
zoneId: cn-hangzhou-b
cidrBlock: 192.168.15.0/24
defaultGateway:
type: alicloud:apig:Gateway
name: default
properties:
gatewayName: ${name}-gw
gatewayType: API
paymentType: PayAsYouGo
spec: apigw.small.x1
networkAccessConfig:
type: Intranet
vpc:
vpcId: ${default.id}
vswitch:
vswitchId: ${defaultSwitch.id}
zoneConfig:
selectOption: Auto
defaultService:
type: alicloud:apig:Service
name: default
properties:
serviceName: ${name}-svc
sourceType: DNS
gatewayId: ${defaultGateway.id}
addresses:
- httpbin.org:8080
defaultPolicy:
type: alicloud:apig:Policy
name: default
properties:
policyName: ${name}
policyClassName: ServiceTls
policyConfig: '{"mode":"SIMPLE","sni":"aaaa","enable":true}'
gatewayId: ${defaultGateway.id}
environmentId: ${defaultGateway.environments[0].environmentId}
attachResourceType: GatewayService
attachResourceIds:
- ${defaultService.id}
pulumi {
required_providers {
alicloud = {
source = "pulumi/alicloud"
}
}
}
resource "alicloud_vpc_network" "default" {
vpc_name ="${var.name}-vpc"
cidr_block = "192.168.0.0/16"
}
resource "alicloud_vpc_switch" "default" {
vswitch_name ="${var.name}-vsw"
vpc_id = alicloud_vpc_network.default.id
zone_id = "cn-hangzhou-b"
cidr_block = "192.168.15.0/24"
}
resource "alicloud_apig_gateway" "default" {
gateway_name ="${var.name}-gw"
gateway_type = "API"
payment_type = "PayAsYouGo"
spec = "apigw.small.x1"
network_access_config = {
type = "Intranet"
}
vpc = {
vpc_id = alicloud_vpc_network.default.id
}
vswitch = {
vswitch_id = alicloud_vpc_switch.default.id
}
zone_config = {
select_option = "Auto"
}
}
resource "alicloud_apig_service" "default" {
service_name ="${var.name}-svc"
source_type = "DNS"
gateway_id = alicloud_apig_gateway.default.id
addresses = ["httpbin.org:8080"]
}
resource "alicloud_apig_policy" "default" {
policy_name = var.name
policy_class_name = "ServiceTls"
policy_config = "{\"mode\":\"SIMPLE\",\"sni\":\"aaaa\",\"enable\":true}"
gateway_id = alicloud_apig_gateway.default.id
environment_id = alicloud_apig_gateway.default.environments[0].environment_id
attach_resource_type = "GatewayService"
attach_resource_ids = [alicloud_apig_service.default.id]
}
variable "name" {
type = string
default = "terraform-example"
}
📚 Need more examples? VIEW MORE EXAMPLES
Create Policy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Policy(name: string, args: PolicyArgs, opts?: CustomResourceOptions);@overload
def Policy(resource_name: str,
args: PolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Policy(resource_name: str,
opts: Optional[ResourceOptions] = None,
attach_resource_ids: Optional[Sequence[str]] = None,
attach_resource_type: Optional[str] = None,
policy_class_name: Optional[str] = None,
policy_config: Optional[str] = None,
environment_id: Optional[str] = None,
gateway_id: Optional[str] = None,
policy_name: Optional[str] = None)func NewPolicy(ctx *Context, name string, args PolicyArgs, opts ...ResourceOption) (*Policy, error)public Policy(string name, PolicyArgs args, CustomResourceOptions? opts = null)
public Policy(String name, PolicyArgs args)
public Policy(String name, PolicyArgs args, CustomResourceOptions options)
type: alicloud:apig:Policy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "alicloud_apig_policy" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args PolicyArgs
- 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 PolicyArgs
- 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 PolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var policyResource = new AliCloud.Apig.Policy("policyResource", new()
{
AttachResourceIds = new[]
{
"string",
},
AttachResourceType = "string",
PolicyClassName = "string",
PolicyConfig = "string",
EnvironmentId = "string",
GatewayId = "string",
PolicyName = "string",
});
example, err := apig.NewPolicy(ctx, "policyResource", &apig.PolicyArgs{
AttachResourceIds: pulumi.StringArray{
pulumi.String("string"),
},
AttachResourceType: pulumi.String("string"),
PolicyClassName: pulumi.String("string"),
PolicyConfig: pulumi.String("string"),
EnvironmentId: pulumi.String("string"),
GatewayId: pulumi.String("string"),
PolicyName: pulumi.String("string"),
})
resource "alicloud_apig_policy" "policyResource" {
lifecycle {
create_before_destroy = true
}
attach_resource_ids = ["string"]
attach_resource_type = "string"
policy_class_name = "string"
policy_config = "string"
environment_id = "string"
gateway_id = "string"
policy_name = "string"
}
var policyResource = new com.pulumi.alicloud.apig.Policy("policyResource", com.pulumi.alicloud.apig.PolicyArgs.builder()
.attachResourceIds("string")
.attachResourceType("string")
.policyClassName("string")
.policyConfig("string")
.environmentId("string")
.gatewayId("string")
.policyName("string")
.build());
policy_resource = alicloud.apig.Policy("policyResource",
attach_resource_ids=["string"],
attach_resource_type="string",
policy_class_name="string",
policy_config="string",
environment_id="string",
gateway_id="string",
policy_name="string")
const policyResource = new alicloud.apig.Policy("policyResource", {
attachResourceIds: ["string"],
attachResourceType: "string",
policyClassName: "string",
policyConfig: "string",
environmentId: "string",
gatewayId: "string",
policyName: "string",
});
type: alicloud:apig:Policy
properties:
attachResourceIds:
- string
attachResourceType: string
environmentId: string
gatewayId: string
policyClassName: string
policyConfig: string
policyName: string
Policy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Policy resource accepts the following input properties:
- Attach
Resource List<string>Ids - The Mount point id list.
- Attach
Resource stringType - Policies support mount point types.
- HttpApi:HttpApi.
- Operation: the Operation of the HttpApi.
- GatewayRoute: Gateway route.
- GatewayService: Gateway service.
- GatewayServicePort: The Gateway service port.
- Domain: The Gateway Domain name.
- Gateway: Gateway.
- Policy
Class stringName - policy class name
- Policy
Config string - Policy Configuration
- Environment
Id string - Environment id
- Gateway
Id string - Gateway id
- Policy
Name string - Policy Name
- Attach
Resource []stringIds - The Mount point id list.
- Attach
Resource stringType - Policies support mount point types.
- HttpApi:HttpApi.
- Operation: the Operation of the HttpApi.
- GatewayRoute: Gateway route.
- GatewayService: Gateway service.
- GatewayServicePort: The Gateway service port.
- Domain: The Gateway Domain name.
- Gateway: Gateway.
- Policy
Class stringName - policy class name
- Policy
Config string - Policy Configuration
- Environment
Id string - Environment id
- Gateway
Id string - Gateway id
- Policy
Name string - Policy Name
- attach_
resource_ list(string)ids - The Mount point id list.
- attach_
resource_ stringtype - Policies support mount point types.
- HttpApi:HttpApi.
- Operation: the Operation of the HttpApi.
- GatewayRoute: Gateway route.
- GatewayService: Gateway service.
- GatewayServicePort: The Gateway service port.
- Domain: The Gateway Domain name.
- Gateway: Gateway.
- policy_
class_ stringname - policy class name
- policy_
config string - Policy Configuration
- environment_
id string - Environment id
- gateway_
id string - Gateway id
- policy_
name string - Policy Name
- attach
Resource List<String>Ids - The Mount point id list.
- attach
Resource StringType - Policies support mount point types.
- HttpApi:HttpApi.
- Operation: the Operation of the HttpApi.
- GatewayRoute: Gateway route.
- GatewayService: Gateway service.
- GatewayServicePort: The Gateway service port.
- Domain: The Gateway Domain name.
- Gateway: Gateway.
- policy
Class StringName - policy class name
- policy
Config String - Policy Configuration
- environment
Id String - Environment id
- gateway
Id String - Gateway id
- policy
Name String - Policy Name
- attach
Resource string[]Ids - The Mount point id list.
- attach
Resource stringType - Policies support mount point types.
- HttpApi:HttpApi.
- Operation: the Operation of the HttpApi.
- GatewayRoute: Gateway route.
- GatewayService: Gateway service.
- GatewayServicePort: The Gateway service port.
- Domain: The Gateway Domain name.
- Gateway: Gateway.
- policy
Class stringName - policy class name
- policy
Config string - Policy Configuration
- environment
Id string - Environment id
- gateway
Id string - Gateway id
- policy
Name string - Policy Name
- attach_
resource_ Sequence[str]ids - The Mount point id list.
- attach_
resource_ strtype - Policies support mount point types.
- HttpApi:HttpApi.
- Operation: the Operation of the HttpApi.
- GatewayRoute: Gateway route.
- GatewayService: Gateway service.
- GatewayServicePort: The Gateway service port.
- Domain: The Gateway Domain name.
- Gateway: Gateway.
- policy_
class_ strname - policy class name
- policy_
config str - Policy Configuration
- environment_
id str - Environment id
- gateway_
id str - Gateway id
- policy_
name str - Policy Name
- attach
Resource List<String>Ids - The Mount point id list.
- attach
Resource StringType - Policies support mount point types.
- HttpApi:HttpApi.
- Operation: the Operation of the HttpApi.
- GatewayRoute: Gateway route.
- GatewayService: Gateway service.
- GatewayServicePort: The Gateway service port.
- Domain: The Gateway Domain name.
- Gateway: Gateway.
- policy
Class StringName - policy class name
- policy
Config String - Policy Configuration
- environment
Id String - Environment id
- gateway
Id String - Gateway id
- policy
Name String - Policy Name
Outputs
All input properties are implicitly available as output properties. Additionally, the Policy resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Policy
Class stringId - policy class id.
- Id string
- The provider-assigned unique ID for this managed resource.
- Policy
Class stringId - policy class id.
- id string
- The provider-assigned unique ID for this managed resource.
- policy_
class_ stringid - policy class id.
- id String
- The provider-assigned unique ID for this managed resource.
- policy
Class StringId - policy class id.
- id string
- The provider-assigned unique ID for this managed resource.
- policy
Class stringId - policy class id.
- id str
- The provider-assigned unique ID for this managed resource.
- policy_
class_ strid - policy class id.
- id String
- The provider-assigned unique ID for this managed resource.
- policy
Class StringId - policy class id.
Look up Existing Policy Resource
Get an existing Policy 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?: PolicyState, opts?: CustomResourceOptions): Policy@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
attach_resource_ids: Optional[Sequence[str]] = None,
attach_resource_type: Optional[str] = None,
environment_id: Optional[str] = None,
gateway_id: Optional[str] = None,
policy_class_id: Optional[str] = None,
policy_class_name: Optional[str] = None,
policy_config: Optional[str] = None,
policy_name: Optional[str] = None) -> Policyfunc GetPolicy(ctx *Context, name string, id IDInput, state *PolicyState, opts ...ResourceOption) (*Policy, error)public static Policy Get(string name, Input<string> id, PolicyState? state, CustomResourceOptions? opts = null)public static Policy get(String name, Output<String> id, PolicyState state, CustomResourceOptions options)resources: _: type: alicloud:apig:Policy get: id: ${id}import {
to = alicloud_apig_policy.example
id = "${id}"
}
- 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.
- Attach
Resource List<string>Ids - The Mount point id list.
- Attach
Resource stringType - Policies support mount point types.
- HttpApi:HttpApi.
- Operation: the Operation of the HttpApi.
- GatewayRoute: Gateway route.
- GatewayService: Gateway service.
- GatewayServicePort: The Gateway service port.
- Domain: The Gateway Domain name.
- Gateway: Gateway.
- Environment
Id string - Environment id
- Gateway
Id string - Gateway id
- Policy
Class stringId - policy class id.
- Policy
Class stringName - policy class name
- Policy
Config string - Policy Configuration
- Policy
Name string - Policy Name
- Attach
Resource []stringIds - The Mount point id list.
- Attach
Resource stringType - Policies support mount point types.
- HttpApi:HttpApi.
- Operation: the Operation of the HttpApi.
- GatewayRoute: Gateway route.
- GatewayService: Gateway service.
- GatewayServicePort: The Gateway service port.
- Domain: The Gateway Domain name.
- Gateway: Gateway.
- Environment
Id string - Environment id
- Gateway
Id string - Gateway id
- Policy
Class stringId - policy class id.
- Policy
Class stringName - policy class name
- Policy
Config string - Policy Configuration
- Policy
Name string - Policy Name
- attach_
resource_ list(string)ids - The Mount point id list.
- attach_
resource_ stringtype - Policies support mount point types.
- HttpApi:HttpApi.
- Operation: the Operation of the HttpApi.
- GatewayRoute: Gateway route.
- GatewayService: Gateway service.
- GatewayServicePort: The Gateway service port.
- Domain: The Gateway Domain name.
- Gateway: Gateway.
- environment_
id string - Environment id
- gateway_
id string - Gateway id
- policy_
class_ stringid - policy class id.
- policy_
class_ stringname - policy class name
- policy_
config string - Policy Configuration
- policy_
name string - Policy Name
- attach
Resource List<String>Ids - The Mount point id list.
- attach
Resource StringType - Policies support mount point types.
- HttpApi:HttpApi.
- Operation: the Operation of the HttpApi.
- GatewayRoute: Gateway route.
- GatewayService: Gateway service.
- GatewayServicePort: The Gateway service port.
- Domain: The Gateway Domain name.
- Gateway: Gateway.
- environment
Id String - Environment id
- gateway
Id String - Gateway id
- policy
Class StringId - policy class id.
- policy
Class StringName - policy class name
- policy
Config String - Policy Configuration
- policy
Name String - Policy Name
- attach
Resource string[]Ids - The Mount point id list.
- attach
Resource stringType - Policies support mount point types.
- HttpApi:HttpApi.
- Operation: the Operation of the HttpApi.
- GatewayRoute: Gateway route.
- GatewayService: Gateway service.
- GatewayServicePort: The Gateway service port.
- Domain: The Gateway Domain name.
- Gateway: Gateway.
- environment
Id string - Environment id
- gateway
Id string - Gateway id
- policy
Class stringId - policy class id.
- policy
Class stringName - policy class name
- policy
Config string - Policy Configuration
- policy
Name string - Policy Name
- attach_
resource_ Sequence[str]ids - The Mount point id list.
- attach_
resource_ strtype - Policies support mount point types.
- HttpApi:HttpApi.
- Operation: the Operation of the HttpApi.
- GatewayRoute: Gateway route.
- GatewayService: Gateway service.
- GatewayServicePort: The Gateway service port.
- Domain: The Gateway Domain name.
- Gateway: Gateway.
- environment_
id str - Environment id
- gateway_
id str - Gateway id
- policy_
class_ strid - policy class id.
- policy_
class_ strname - policy class name
- policy_
config str - Policy Configuration
- policy_
name str - Policy Name
- attach
Resource List<String>Ids - The Mount point id list.
- attach
Resource StringType - Policies support mount point types.
- HttpApi:HttpApi.
- Operation: the Operation of the HttpApi.
- GatewayRoute: Gateway route.
- GatewayService: Gateway service.
- GatewayServicePort: The Gateway service port.
- Domain: The Gateway Domain name.
- Gateway: Gateway.
- environment
Id String - Environment id
- gateway
Id String - Gateway id
- policy
Class StringId - policy class id.
- policy
Class StringName - policy class name
- policy
Config String - Policy Configuration
- policy
Name String - Policy Name
Import
APIG Policy can be imported using the id, e.g.
$ pulumi import alicloud:apig/policy:Policy example <policy_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
published on Thursday, Sep 17, 2026 by Pulumi