1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ga
  5. AclAttachment
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

alicloud.ga.AclAttachment

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

    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

    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", {
        listenerId: defaultListener.id,
        aclId: defaultAcl.id,
        aclType: "white",
    });
    
    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",
        listener_id=default_listener.id,
        acl_id=default_acl.id,
        acl_type="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{
    			ListenerId: defaultListener.ID(),
    			AclId:      defaultAcl.ID(),
    			AclType:    pulumi.String("white"),
    		})
    		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 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()
        {
            ListenerId = defaultListener.Id,
            AclId = defaultAcl.Id,
            AclType = "white",
        });
    
    });
    
    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()        
                .listenerId(defaultListener.id())
                .aclId(defaultAcl.id())
                .aclType("white")
                .build());
    
        }
    }
    
    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:
          listenerId: ${defaultListener.id}
          aclId: ${defaultAcl.id}
          aclType: white
    

    Create AclAttachment Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AclAttachment(name: string, args: AclAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def AclAttachment(resource_name: str,
                      args: AclAttachmentArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def AclAttachment(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      acl_id: Optional[str] = None,
                      acl_type: Optional[str] = None,
                      listener_id: Optional[str] = None,
                      dry_run: Optional[bool] = 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.
    
    

    Parameters

    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.

    Example

    The following reference example uses placeholder values for all input properties.

    var aclAttachmentResource = new AliCloud.Ga.AclAttachment("aclAttachmentResource", new()
    {
        AclId = "string",
        AclType = "string",
        ListenerId = "string",
        DryRun = false,
    });
    
    example, err := ga.NewAclAttachment(ctx, "aclAttachmentResource", &ga.AclAttachmentArgs{
    	AclId:      pulumi.String("string"),
    	AclType:    pulumi.String("string"),
    	ListenerId: pulumi.String("string"),
    	DryRun:     pulumi.Bool(false),
    })
    
    var aclAttachmentResource = new AclAttachment("aclAttachmentResource", AclAttachmentArgs.builder()        
        .aclId("string")
        .aclType("string")
        .listenerId("string")
        .dryRun(false)
        .build());
    
    acl_attachment_resource = alicloud.ga.AclAttachment("aclAttachmentResource",
        acl_id="string",
        acl_type="string",
        listener_id="string",
        dry_run=False)
    
    const aclAttachmentResource = new alicloud.ga.AclAttachment("aclAttachmentResource", {
        aclId: "string",
        aclType: "string",
        listenerId: "string",
        dryRun: false,
    });
    
    type: alicloud:ga:AclAttachment
    properties:
        aclId: string
        aclType: string
        dryRun: false
        listenerId: string
    

    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:

    AclId string
    The ID of an ACL.
    AclType string
    The type of the ACL. Valid values:
    ListenerId string
    The ID of the listener.
    DryRun bool
    The dry run.
    AclId string
    The ID of an ACL.
    AclType string
    The type of the ACL. Valid values:
    ListenerId string
    The ID of the listener.
    DryRun bool
    The dry run.
    aclId String
    The ID of an ACL.
    aclType String
    The type of the ACL. Valid values:
    listenerId String
    The ID of the listener.
    dryRun Boolean
    The dry run.
    aclId string
    The ID of an ACL.
    aclType string
    The type of the ACL. Valid values:
    listenerId string
    The ID of the listener.
    dryRun boolean
    The dry run.
    acl_id str
    The ID of an ACL.
    acl_type str
    The type of the ACL. Valid values:
    listener_id str
    The ID of the listener.
    dry_run bool
    The dry run.
    aclId String
    The ID of an ACL.
    aclType String
    The type of the ACL. Valid values:
    listenerId String
    The ID of the listener.
    dryRun Boolean
    The dry run.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AclAttachment resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the Acl Attachment.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the Acl Attachment.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the Acl Attachment.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the Acl Attachment.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the Acl Attachment.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the Acl Attachment.

    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.
    The following state arguments are supported:
    AclId string
    The ID of an ACL.
    AclType string
    The type of the ACL. Valid values:
    DryRun bool
    The dry run.
    ListenerId string
    The ID of the listener.
    Status string
    The status of the Acl Attachment.
    AclId string
    The ID of an ACL.
    AclType string
    The type of the ACL. Valid values:
    DryRun bool
    The dry run.
    ListenerId string
    The ID of the listener.
    Status string
    The status of the Acl Attachment.
    aclId String
    The ID of an ACL.
    aclType String
    The type of the ACL. Valid values:
    dryRun Boolean
    The dry run.
    listenerId String
    The ID of the listener.
    status String
    The status of the Acl Attachment.
    aclId string
    The ID of an ACL.
    aclType string
    The type of the ACL. Valid values:
    dryRun boolean
    The dry run.
    listenerId string
    The ID of the listener.
    status string
    The status of the Acl Attachment.
    acl_id str
    The ID of an ACL.
    acl_type str
    The type of the ACL. Valid values:
    dry_run bool
    The dry run.
    listener_id str
    The ID of the listener.
    status str
    The status of the Acl Attachment.
    aclId String
    The ID of an ACL.
    aclType String
    The type of the ACL. Valid values:
    dryRun Boolean
    The dry run.
    listenerId String
    The ID of the listener.
    status String
    The status of the Acl Attachment.

    Import

    Global Accelerator (GA) Acl Attachment can be imported using the id, e.g.

    $ pulumi import alicloud:ga/aclAttachment:AclAttachment example <listener_id>:<acl_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 alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi