1. Packages
  2. Alicloud Provider
  3. API Docs
  4. ga
  5. AclAttachment
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.ga.AclAttachment

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 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 _default = new alicloud.ga.Accelerator("default", {
        duration: 1,
        autoUseCoupon: true,
        spec: "1",
    });
    const defaultBandwidthPackage = new alicloud.ga.BandwidthPackage("default", {
        bandwidth: 100,
        type: "Basic",
        bandwidthType: "Basic",
        paymentType: "PayAsYouGo",
        billingType: "PayBy95",
        ratio: 30,
    });
    const defaultBandwidthPackageAttachment = new alicloud.ga.BandwidthPackageAttachment("default", {
        acceleratorId: _default.id,
        bandwidthPackageId: defaultBandwidthPackage.id,
    });
    const defaultListener = new alicloud.ga.Listener("default", {
        acceleratorId: defaultBandwidthPackageAttachment.acceleratorId,
        portRanges: [{
            fromPort: 80,
            toPort: 80,
        }],
    });
    const defaultAcl = new alicloud.ga.Acl("default", {
        aclName: "terraform-example",
        addressIpVersion: "IPv4",
    });
    const defaultAclEntryAttachment = new alicloud.ga.AclEntryAttachment("default", {
        aclId: defaultAcl.id,
        entry: "192.168.1.1/32",
        entryDescription: "terraform-example",
    });
    const defaultAclAttachment = new alicloud.ga.AclAttachment("default", {
        listenerId: defaultListener.id,
        aclId: defaultAcl.id,
        aclType: "white",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.ga.Accelerator("default",
        duration=1,
        auto_use_coupon=True,
        spec="1")
    default_bandwidth_package = alicloud.ga.BandwidthPackage("default",
        bandwidth=100,
        type="Basic",
        bandwidth_type="Basic",
        payment_type="PayAsYouGo",
        billing_type="PayBy95",
        ratio=30)
    default_bandwidth_package_attachment = alicloud.ga.BandwidthPackageAttachment("default",
        accelerator_id=default.id,
        bandwidth_package_id=default_bandwidth_package.id)
    default_listener = alicloud.ga.Listener("default",
        accelerator_id=default_bandwidth_package_attachment.accelerator_id,
        port_ranges=[{
            "from_port": 80,
            "to_port": 80,
        }])
    default_acl = alicloud.ga.Acl("default",
        acl_name="terraform-example",
        address_ip_version="IPv4")
    default_acl_entry_attachment = alicloud.ga.AclEntryAttachment("default",
        acl_id=default_acl.id,
        entry="192.168.1.1/32",
        entry_description="terraform-example")
    default_acl_attachment = alicloud.ga.AclAttachment("default",
        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 {
    		_, err := ga.NewAccelerator(ctx, "default", &ga.AcceleratorArgs{
    			Duration:      pulumi.Int(1),
    			AutoUseCoupon: pulumi.Bool(true),
    			Spec:          pulumi.String("1"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultBandwidthPackage, err := ga.NewBandwidthPackage(ctx, "default", &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, "default", &ga.BandwidthPackageAttachmentArgs{
    			AcceleratorId:      _default.ID(),
    			BandwidthPackageId: defaultBandwidthPackage.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		defaultListener, err := ga.NewListener(ctx, "default", &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, "default", &ga.AclArgs{
    			AclName:          pulumi.String("terraform-example"),
    			AddressIpVersion: pulumi.String("IPv4"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ga.NewAclEntryAttachment(ctx, "default", &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, "default", &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 @default = new AliCloud.Ga.Accelerator("default", new()
        {
            Duration = 1,
            AutoUseCoupon = true,
            Spec = "1",
        });
    
        var defaultBandwidthPackage = new AliCloud.Ga.BandwidthPackage("default", new()
        {
            Bandwidth = 100,
            Type = "Basic",
            BandwidthType = "Basic",
            PaymentType = "PayAsYouGo",
            BillingType = "PayBy95",
            Ratio = 30,
        });
    
        var defaultBandwidthPackageAttachment = new AliCloud.Ga.BandwidthPackageAttachment("default", new()
        {
            AcceleratorId = @default.Id,
            BandwidthPackageId = defaultBandwidthPackage.Id,
        });
    
        var defaultListener = new AliCloud.Ga.Listener("default", new()
        {
            AcceleratorId = defaultBandwidthPackageAttachment.AcceleratorId,
            PortRanges = new[]
            {
                new AliCloud.Ga.Inputs.ListenerPortRangeArgs
                {
                    FromPort = 80,
                    ToPort = 80,
                },
            },
        });
    
        var defaultAcl = new AliCloud.Ga.Acl("default", new()
        {
            AclName = "terraform-example",
            AddressIpVersion = "IPv4",
        });
    
        var defaultAclEntryAttachment = new AliCloud.Ga.AclEntryAttachment("default", new()
        {
            AclId = defaultAcl.Id,
            Entry = "192.168.1.1/32",
            EntryDescription = "terraform-example",
        });
    
        var defaultAclAttachment = new AliCloud.Ga.AclAttachment("default", 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 default_ = new Accelerator("default", 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(default_.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:
      default:
        type: alicloud:ga:Accelerator
        properties:
          duration: 1
          autoUseCoupon: true
          spec: '1'
      defaultBandwidthPackage:
        type: alicloud:ga:BandwidthPackage
        name: default
        properties:
          bandwidth: 100
          type: Basic
          bandwidthType: Basic
          paymentType: PayAsYouGo
          billingType: PayBy95
          ratio: 30
      defaultBandwidthPackageAttachment:
        type: alicloud:ga:BandwidthPackageAttachment
        name: default
        properties:
          acceleratorId: ${default.id}
          bandwidthPackageId: ${defaultBandwidthPackage.id}
      defaultListener:
        type: alicloud:ga:Listener
        name: default
        properties:
          acceleratorId: ${defaultBandwidthPackageAttachment.acceleratorId}
          portRanges:
            - fromPort: 80
              toPort: 80
      defaultAcl:
        type: alicloud:ga:Acl
        name: default
        properties:
          aclName: terraform-example
          addressIpVersion: IPv4
      defaultAclEntryAttachment:
        type: alicloud:ga:AclEntryAttachment
        name: default
        properties:
          aclId: ${defaultAcl.id}
          entry: 192.168.1.1/32
          entryDescription: terraform-example
      defaultAclAttachment:
        type: alicloud:ga:AclAttachment
        name: default
        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.

    Constructor 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.62.1 published on Monday, Sep 16, 2024 by Pulumi