alicloud.ga.AclAttachment
Explore with Pulumi AI
Provides a Global Accelerator (GA) Acl Attachment resource.
For information about Global Accelerator (GA) Acl Attachment and how to use it, see What is Acl Attachment.
NOTE: Available since v1.150.0.
Example Usage
Basic Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var defaultAccelerator = new AliCloud.Ga.Accelerator("defaultAccelerator", new()
{
Duration = 1,
AutoUseCoupon = true,
Spec = "1",
});
var defaultBandwidthPackage = new AliCloud.Ga.BandwidthPackage("defaultBandwidthPackage", new()
{
Bandwidth = 100,
Type = "Basic",
BandwidthType = "Basic",
PaymentType = "PayAsYouGo",
BillingType = "PayBy95",
Ratio = 30,
});
var defaultBandwidthPackageAttachment = new AliCloud.Ga.BandwidthPackageAttachment("defaultBandwidthPackageAttachment", new()
{
AcceleratorId = defaultAccelerator.Id,
BandwidthPackageId = defaultBandwidthPackage.Id,
});
var defaultListener = new AliCloud.Ga.Listener("defaultListener", new()
{
AcceleratorId = defaultBandwidthPackageAttachment.AcceleratorId,
PortRanges = new[]
{
new AliCloud.Ga.Inputs.ListenerPortRangeArgs
{
FromPort = 80,
ToPort = 80,
},
},
});
var defaultAcl = new AliCloud.Ga.Acl("defaultAcl", new()
{
AclName = "terraform-example",
AddressIpVersion = "IPv4",
});
var defaultAclEntryAttachment = new AliCloud.Ga.AclEntryAttachment("defaultAclEntryAttachment", new()
{
AclId = defaultAcl.Id,
Entry = "192.168.1.1/32",
EntryDescription = "terraform-example",
});
var defaultAclAttachment = new AliCloud.Ga.AclAttachment("defaultAclAttachment", new()
{
AclId = defaultAcl.Id,
ListenerId = defaultListener.Id,
AclType = "white",
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ga"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
defaultAccelerator, err := ga.NewAccelerator(ctx, "defaultAccelerator", &ga.AcceleratorArgs{
Duration: pulumi.Int(1),
AutoUseCoupon: pulumi.Bool(true),
Spec: pulumi.String("1"),
})
if err != nil {
return err
}
defaultBandwidthPackage, err := ga.NewBandwidthPackage(ctx, "defaultBandwidthPackage", &ga.BandwidthPackageArgs{
Bandwidth: pulumi.Int(100),
Type: pulumi.String("Basic"),
BandwidthType: pulumi.String("Basic"),
PaymentType: pulumi.String("PayAsYouGo"),
BillingType: pulumi.String("PayBy95"),
Ratio: pulumi.Int(30),
})
if err != nil {
return err
}
defaultBandwidthPackageAttachment, err := ga.NewBandwidthPackageAttachment(ctx, "defaultBandwidthPackageAttachment", &ga.BandwidthPackageAttachmentArgs{
AcceleratorId: defaultAccelerator.ID(),
BandwidthPackageId: defaultBandwidthPackage.ID(),
})
if err != nil {
return err
}
defaultListener, err := ga.NewListener(ctx, "defaultListener", &ga.ListenerArgs{
AcceleratorId: defaultBandwidthPackageAttachment.AcceleratorId,
PortRanges: ga.ListenerPortRangeArray{
&ga.ListenerPortRangeArgs{
FromPort: pulumi.Int(80),
ToPort: pulumi.Int(80),
},
},
})
if err != nil {
return err
}
defaultAcl, err := ga.NewAcl(ctx, "defaultAcl", &ga.AclArgs{
AclName: pulumi.String("terraform-example"),
AddressIpVersion: pulumi.String("IPv4"),
})
if err != nil {
return err
}
_, err = ga.NewAclEntryAttachment(ctx, "defaultAclEntryAttachment", &ga.AclEntryAttachmentArgs{
AclId: defaultAcl.ID(),
Entry: pulumi.String("192.168.1.1/32"),
EntryDescription: pulumi.String("terraform-example"),
})
if err != nil {
return err
}
_, err = ga.NewAclAttachment(ctx, "defaultAclAttachment", &ga.AclAttachmentArgs{
AclId: defaultAcl.ID(),
ListenerId: defaultListener.ID(),
AclType: pulumi.String("white"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ga.Accelerator;
import com.pulumi.alicloud.ga.AcceleratorArgs;
import com.pulumi.alicloud.ga.BandwidthPackage;
import com.pulumi.alicloud.ga.BandwidthPackageArgs;
import com.pulumi.alicloud.ga.BandwidthPackageAttachment;
import com.pulumi.alicloud.ga.BandwidthPackageAttachmentArgs;
import com.pulumi.alicloud.ga.Listener;
import com.pulumi.alicloud.ga.ListenerArgs;
import com.pulumi.alicloud.ga.inputs.ListenerPortRangeArgs;
import com.pulumi.alicloud.ga.Acl;
import com.pulumi.alicloud.ga.AclArgs;
import com.pulumi.alicloud.ga.AclEntryAttachment;
import com.pulumi.alicloud.ga.AclEntryAttachmentArgs;
import com.pulumi.alicloud.ga.AclAttachment;
import com.pulumi.alicloud.ga.AclAttachmentArgs;
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) {
var defaultAccelerator = new Accelerator("defaultAccelerator", AcceleratorArgs.builder()
.duration(1)
.autoUseCoupon(true)
.spec("1")
.build());
var defaultBandwidthPackage = new BandwidthPackage("defaultBandwidthPackage", BandwidthPackageArgs.builder()
.bandwidth(100)
.type("Basic")
.bandwidthType("Basic")
.paymentType("PayAsYouGo")
.billingType("PayBy95")
.ratio(30)
.build());
var defaultBandwidthPackageAttachment = new BandwidthPackageAttachment("defaultBandwidthPackageAttachment", BandwidthPackageAttachmentArgs.builder()
.acceleratorId(defaultAccelerator.id())
.bandwidthPackageId(defaultBandwidthPackage.id())
.build());
var defaultListener = new Listener("defaultListener", ListenerArgs.builder()
.acceleratorId(defaultBandwidthPackageAttachment.acceleratorId())
.portRanges(ListenerPortRangeArgs.builder()
.fromPort(80)
.toPort(80)
.build())
.build());
var defaultAcl = new Acl("defaultAcl", AclArgs.builder()
.aclName("terraform-example")
.addressIpVersion("IPv4")
.build());
var defaultAclEntryAttachment = new AclEntryAttachment("defaultAclEntryAttachment", AclEntryAttachmentArgs.builder()
.aclId(defaultAcl.id())
.entry("192.168.1.1/32")
.entryDescription("terraform-example")
.build());
var defaultAclAttachment = new AclAttachment("defaultAclAttachment", AclAttachmentArgs.builder()
.aclId(defaultAcl.id())
.listenerId(defaultListener.id())
.aclType("white")
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
default_accelerator = alicloud.ga.Accelerator("defaultAccelerator",
duration=1,
auto_use_coupon=True,
spec="1")
default_bandwidth_package = alicloud.ga.BandwidthPackage("defaultBandwidthPackage",
bandwidth=100,
type="Basic",
bandwidth_type="Basic",
payment_type="PayAsYouGo",
billing_type="PayBy95",
ratio=30)
default_bandwidth_package_attachment = alicloud.ga.BandwidthPackageAttachment("defaultBandwidthPackageAttachment",
accelerator_id=default_accelerator.id,
bandwidth_package_id=default_bandwidth_package.id)
default_listener = alicloud.ga.Listener("defaultListener",
accelerator_id=default_bandwidth_package_attachment.accelerator_id,
port_ranges=[alicloud.ga.ListenerPortRangeArgs(
from_port=80,
to_port=80,
)])
default_acl = alicloud.ga.Acl("defaultAcl",
acl_name="terraform-example",
address_ip_version="IPv4")
default_acl_entry_attachment = alicloud.ga.AclEntryAttachment("defaultAclEntryAttachment",
acl_id=default_acl.id,
entry="192.168.1.1/32",
entry_description="terraform-example")
default_acl_attachment = alicloud.ga.AclAttachment("defaultAclAttachment",
acl_id=default_acl.id,
listener_id=default_listener.id,
acl_type="white")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const defaultAccelerator = new alicloud.ga.Accelerator("defaultAccelerator", {
duration: 1,
autoUseCoupon: true,
spec: "1",
});
const defaultBandwidthPackage = new alicloud.ga.BandwidthPackage("defaultBandwidthPackage", {
bandwidth: 100,
type: "Basic",
bandwidthType: "Basic",
paymentType: "PayAsYouGo",
billingType: "PayBy95",
ratio: 30,
});
const defaultBandwidthPackageAttachment = new alicloud.ga.BandwidthPackageAttachment("defaultBandwidthPackageAttachment", {
acceleratorId: defaultAccelerator.id,
bandwidthPackageId: defaultBandwidthPackage.id,
});
const defaultListener = new alicloud.ga.Listener("defaultListener", {
acceleratorId: defaultBandwidthPackageAttachment.acceleratorId,
portRanges: [{
fromPort: 80,
toPort: 80,
}],
});
const defaultAcl = new alicloud.ga.Acl("defaultAcl", {
aclName: "terraform-example",
addressIpVersion: "IPv4",
});
const defaultAclEntryAttachment = new alicloud.ga.AclEntryAttachment("defaultAclEntryAttachment", {
aclId: defaultAcl.id,
entry: "192.168.1.1/32",
entryDescription: "terraform-example",
});
const defaultAclAttachment = new alicloud.ga.AclAttachment("defaultAclAttachment", {
aclId: defaultAcl.id,
listenerId: defaultListener.id,
aclType: "white",
});
resources:
defaultAccelerator:
type: alicloud:ga:Accelerator
properties:
duration: 1
autoUseCoupon: true
spec: '1'
defaultBandwidthPackage:
type: alicloud:ga:BandwidthPackage
properties:
bandwidth: 100
type: Basic
bandwidthType: Basic
paymentType: PayAsYouGo
billingType: PayBy95
ratio: 30
defaultBandwidthPackageAttachment:
type: alicloud:ga:BandwidthPackageAttachment
properties:
acceleratorId: ${defaultAccelerator.id}
bandwidthPackageId: ${defaultBandwidthPackage.id}
defaultListener:
type: alicloud:ga:Listener
properties:
acceleratorId: ${defaultBandwidthPackageAttachment.acceleratorId}
portRanges:
- fromPort: 80
toPort: 80
defaultAcl:
type: alicloud:ga:Acl
properties:
aclName: terraform-example
addressIpVersion: IPv4
defaultAclEntryAttachment:
type: alicloud:ga:AclEntryAttachment
properties:
aclId: ${defaultAcl.id}
entry: 192.168.1.1/32
entryDescription: terraform-example
defaultAclAttachment:
type: alicloud:ga:AclAttachment
properties:
aclId: ${defaultAcl.id}
listenerId: ${defaultListener.id}
aclType: white
Create AclAttachment Resource
new AclAttachment(name: string, args: AclAttachmentArgs, opts?: CustomResourceOptions);
@overload
def AclAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
acl_id: Optional[str] = None,
acl_type: Optional[str] = None,
dry_run: Optional[bool] = None,
listener_id: Optional[str] = None)
@overload
def AclAttachment(resource_name: str,
args: AclAttachmentArgs,
opts: Optional[ResourceOptions] = None)
func NewAclAttachment(ctx *Context, name string, args AclAttachmentArgs, opts ...ResourceOption) (*AclAttachment, error)
public AclAttachment(string name, AclAttachmentArgs args, CustomResourceOptions? opts = null)
public AclAttachment(String name, AclAttachmentArgs args)
public AclAttachment(String name, AclAttachmentArgs args, CustomResourceOptions options)
type: alicloud:ga:AclAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AclAttachmentArgs
- 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 AclAttachmentArgs
- 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 AclAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AclAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AclAttachmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
AclAttachment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The AclAttachment resource accepts the following input properties:
- Acl
Id string The ID of an ACL.
- Acl
Type string The type of the ACL. Valid values:
white
,black
.- Listener
Id string The ID of the listener.
- Dry
Run bool The dry run.
- Acl
Id string The ID of an ACL.
- Acl
Type string The type of the ACL. Valid values:
white
,black
.- Listener
Id string The ID of the listener.
- Dry
Run bool The dry run.
- acl
Id String The ID of an ACL.
- acl
Type String The type of the ACL. Valid values:
white
,black
.- listener
Id String The ID of the listener.
- dry
Run Boolean The dry run.
- acl
Id string The ID of an ACL.
- acl
Type string The type of the ACL. Valid values:
white
,black
.- listener
Id string The ID of the listener.
- dry
Run boolean The dry run.
- acl_
id str The ID of an ACL.
- acl_
type str The type of the ACL. Valid values:
white
,black
.- listener_
id str The ID of the listener.
- dry_
run bool The dry run.
- acl
Id String The ID of an ACL.
- acl
Type String The type of the ACL. Valid values:
white
,black
.- listener
Id String The ID of the listener.
- dry
Run Boolean The dry run.
Outputs
All input properties are implicitly available as output properties. Additionally, the AclAttachment resource produces the following output properties:
Look up Existing AclAttachment Resource
Get an existing AclAttachment 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?: AclAttachmentState, opts?: CustomResourceOptions): AclAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
acl_id: Optional[str] = None,
acl_type: Optional[str] = None,
dry_run: Optional[bool] = None,
listener_id: Optional[str] = None,
status: Optional[str] = None) -> AclAttachment
func GetAclAttachment(ctx *Context, name string, id IDInput, state *AclAttachmentState, opts ...ResourceOption) (*AclAttachment, error)
public static AclAttachment Get(string name, Input<string> id, AclAttachmentState? state, CustomResourceOptions? opts = null)
public static AclAttachment get(String name, Output<String> id, AclAttachmentState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Acl
Id string The ID of an ACL.
- Acl
Type string The type of the ACL. Valid values:
white
,black
.- Dry
Run bool The dry run.
- Listener
Id string The ID of the listener.
- Status string
The status of the resource.
- Acl
Id string The ID of an ACL.
- Acl
Type string The type of the ACL. Valid values:
white
,black
.- Dry
Run bool The dry run.
- Listener
Id string The ID of the listener.
- Status string
The status of the resource.
- acl
Id String The ID of an ACL.
- acl
Type String The type of the ACL. Valid values:
white
,black
.- dry
Run Boolean The dry run.
- listener
Id String The ID of the listener.
- status String
The status of the resource.
- acl
Id string The ID of an ACL.
- acl
Type string The type of the ACL. Valid values:
white
,black
.- dry
Run boolean The dry run.
- listener
Id string The ID of the listener.
- status string
The status of the resource.
- acl_
id str The ID of an ACL.
- acl_
type str The type of the ACL. Valid values:
white
,black
.- dry_
run bool The dry run.
- listener_
id str The ID of the listener.
- status str
The status of the resource.
- acl
Id String The ID of an ACL.
- acl
Type String The type of the ACL. Valid values:
white
,black
.- dry
Run Boolean The dry run.
- listener
Id String The ID of the listener.
- status String
The status of the resource.
Import
Global Accelerator (GA) Acl Attachment can be imported using the id. Format to <listener_id>:<acl_id>
, e.g.
$ pulumi import alicloud:ga/aclAttachment:AclAttachment example your_listener_id:your_acl_id
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.