1. Packages
  2. Volcengine
  3. API Docs
  4. bandwidth_package
  5. Attachment
Volcengine v0.0.23 published on Wednesday, Jan 3, 2024 by Volcengine

volcengine.bandwidth_package.Attachment

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.23 published on Wednesday, Jan 3, 2024 by Volcengine

    Provides a resource to manage bandwidth package attachment

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Volcengine.Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var fooAddress = new Volcengine.Eip.Address("fooAddress", new()
        {
            BillingType = "PostPaidByBandwidth",
            Bandwidth = 1,
            Isp = "BGP",
            Description = "acc-test",
            ProjectName = "default",
            SecurityProtectionTypes = new[]
            {
                "AntiDDoS_Enhanced",
            },
        });
    
        var fooBandwidthPackage = new Volcengine.Bandwidth_package.BandwidthPackage("fooBandwidthPackage", new()
        {
            BandwidthPackageName = "acc-test",
            BillingType = "PostPaidByBandwidth",
            Isp = "BGP",
            Description = "tftest-description",
            Bandwidth = 10,
            Protocol = "IPv4",
            Tags = new[]
            {
                new Volcengine.Bandwidth_package.Inputs.BandwidthPackageTagArgs
                {
                    Key = "tftest",
                    Value = "tftest",
                },
            },
            SecurityProtectionTypes = new[]
            {
                "AntiDDoS_Enhanced",
            },
        });
    
        var fooAttachment = new Volcengine.Bandwidth_package.Attachment("fooAttachment", new()
        {
            AllocationId = fooAddress.Id,
            BandwidthPackageId = fooBandwidthPackage.Id,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/bandwidth_package"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/eip"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fooAddress, err := eip.NewAddress(ctx, "fooAddress", &eip.AddressArgs{
    			BillingType: pulumi.String("PostPaidByBandwidth"),
    			Bandwidth:   pulumi.Int(1),
    			Isp:         pulumi.String("BGP"),
    			Description: pulumi.String("acc-test"),
    			ProjectName: pulumi.String("default"),
    			SecurityProtectionTypes: pulumi.StringArray{
    				pulumi.String("AntiDDoS_Enhanced"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		fooBandwidthPackage, err := bandwidth_package.NewBandwidthPackage(ctx, "fooBandwidthPackage", &bandwidth_package.BandwidthPackageArgs{
    			BandwidthPackageName: pulumi.String("acc-test"),
    			BillingType:          pulumi.String("PostPaidByBandwidth"),
    			Isp:                  pulumi.String("BGP"),
    			Description:          pulumi.String("tftest-description"),
    			Bandwidth:            pulumi.Int(10),
    			Protocol:             pulumi.String("IPv4"),
    			Tags: bandwidth_package.BandwidthPackageTagArray{
    				&bandwidth_package.BandwidthPackageTagArgs{
    					Key:   pulumi.String("tftest"),
    					Value: pulumi.String("tftest"),
    				},
    			},
    			SecurityProtectionTypes: pulumi.StringArray{
    				pulumi.String("AntiDDoS_Enhanced"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = bandwidth_package.NewAttachment(ctx, "fooAttachment", &bandwidth_package.AttachmentArgs{
    			AllocationId:       fooAddress.ID(),
    			BandwidthPackageId: fooBandwidthPackage.ID(),
    		})
    		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.volcengine.eip.Address;
    import com.pulumi.volcengine.eip.AddressArgs;
    import com.pulumi.volcengine.bandwidth_package.BandwidthPackage;
    import com.pulumi.volcengine.bandwidth_package.BandwidthPackageArgs;
    import com.pulumi.volcengine.bandwidth_package.inputs.BandwidthPackageTagArgs;
    import com.pulumi.volcengine.bandwidth_package.Attachment;
    import com.pulumi.volcengine.bandwidth_package.AttachmentArgs;
    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 fooAddress = new Address("fooAddress", AddressArgs.builder()        
                .billingType("PostPaidByBandwidth")
                .bandwidth(1)
                .isp("BGP")
                .description("acc-test")
                .projectName("default")
                .securityProtectionTypes("AntiDDoS_Enhanced")
                .build());
    
            var fooBandwidthPackage = new BandwidthPackage("fooBandwidthPackage", BandwidthPackageArgs.builder()        
                .bandwidthPackageName("acc-test")
                .billingType("PostPaidByBandwidth")
                .isp("BGP")
                .description("tftest-description")
                .bandwidth(10)
                .protocol("IPv4")
                .tags(BandwidthPackageTagArgs.builder()
                    .key("tftest")
                    .value("tftest")
                    .build())
                .securityProtectionTypes("AntiDDoS_Enhanced")
                .build());
    
            var fooAttachment = new Attachment("fooAttachment", AttachmentArgs.builder()        
                .allocationId(fooAddress.id())
                .bandwidthPackageId(fooBandwidthPackage.id())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo_address = volcengine.eip.Address("fooAddress",
        billing_type="PostPaidByBandwidth",
        bandwidth=1,
        isp="BGP",
        description="acc-test",
        project_name="default",
        security_protection_types=["AntiDDoS_Enhanced"])
    foo_bandwidth_package = volcengine.bandwidth_package.BandwidthPackage("fooBandwidthPackage",
        bandwidth_package_name="acc-test",
        billing_type="PostPaidByBandwidth",
        isp="BGP",
        description="tftest-description",
        bandwidth=10,
        protocol="IPv4",
        tags=[volcengine.bandwidth_package.BandwidthPackageTagArgs(
            key="tftest",
            value="tftest",
        )],
        security_protection_types=["AntiDDoS_Enhanced"])
    foo_attachment = volcengine.bandwidth_package.Attachment("fooAttachment",
        allocation_id=foo_address.id,
        bandwidth_package_id=foo_bandwidth_package.id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@volcengine/pulumi";
    
    const fooAddress = new volcengine.eip.Address("fooAddress", {
        billingType: "PostPaidByBandwidth",
        bandwidth: 1,
        isp: "BGP",
        description: "acc-test",
        projectName: "default",
        securityProtectionTypes: ["AntiDDoS_Enhanced"],
    });
    const fooBandwidthPackage = new volcengine.bandwidth_package.BandwidthPackage("fooBandwidthPackage", {
        bandwidthPackageName: "acc-test",
        billingType: "PostPaidByBandwidth",
        isp: "BGP",
        description: "tftest-description",
        bandwidth: 10,
        protocol: "IPv4",
        tags: [{
            key: "tftest",
            value: "tftest",
        }],
        securityProtectionTypes: ["AntiDDoS_Enhanced"],
    });
    const fooAttachment = new volcengine.bandwidth_package.Attachment("fooAttachment", {
        allocationId: fooAddress.id,
        bandwidthPackageId: fooBandwidthPackage.id,
    });
    
    resources:
      fooAddress:
        type: volcengine:eip:Address
        properties:
          billingType: PostPaidByBandwidth
          bandwidth: 1
          isp: BGP
          description: acc-test
          projectName: default
          securityProtectionTypes:
            - AntiDDoS_Enhanced
      fooBandwidthPackage:
        type: volcengine:bandwidth_package:BandwidthPackage
        properties:
          bandwidthPackageName: acc-test
          billingType: PostPaidByBandwidth
          isp: BGP
          description: tftest-description
          bandwidth: 10
          protocol: IPv4
          tags:
            - key: tftest
              value: tftest
          securityProtectionTypes:
            - AntiDDoS_Enhanced
      fooAttachment:
        type: volcengine:bandwidth_package:Attachment
        properties:
          allocationId: ${fooAddress.id}
          bandwidthPackageId: ${fooBandwidthPackage.id}
    

    Create Attachment Resource

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

    Constructor syntax

    new Attachment(name: string, args: AttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def Attachment(resource_name: str,
                   args: AttachmentArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def Attachment(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   allocation_id: Optional[str] = None,
                   bandwidth_package_id: Optional[str] = None)
    func NewAttachment(ctx *Context, name string, args AttachmentArgs, opts ...ResourceOption) (*Attachment, error)
    public Attachment(string name, AttachmentArgs args, CustomResourceOptions? opts = null)
    public Attachment(String name, AttachmentArgs args)
    public Attachment(String name, AttachmentArgs args, CustomResourceOptions options)
    
    type: volcengine:bandwidth_package:Attachment
    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 AttachmentArgs
    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 AttachmentArgs
    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 AttachmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AttachmentArgs
    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 attachmentResource = new Volcengine.Bandwidth_package.Attachment("attachmentResource", new()
    {
        AllocationId = "string",
        BandwidthPackageId = "string",
    });
    
    example, err := bandwidth_package.NewAttachment(ctx, "attachmentResource", &bandwidth_package.AttachmentArgs{
    	AllocationId:       pulumi.String("string"),
    	BandwidthPackageId: pulumi.String("string"),
    })
    
    var attachmentResource = new Attachment("attachmentResource", AttachmentArgs.builder()        
        .allocationId("string")
        .bandwidthPackageId("string")
        .build());
    
    attachment_resource = volcengine.bandwidth_package.Attachment("attachmentResource",
        allocation_id="string",
        bandwidth_package_id="string")
    
    const attachmentResource = new volcengine.bandwidth_package.Attachment("attachmentResource", {
        allocationId: "string",
        bandwidthPackageId: "string",
    });
    
    type: volcengine:bandwidth_package:Attachment
    properties:
        allocationId: string
        bandwidthPackageId: string
    

    Attachment 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 Attachment resource accepts the following input properties:

    AllocationId string
    The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
    BandwidthPackageId string
    The bandwidth package id.
    AllocationId string
    The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
    BandwidthPackageId string
    The bandwidth package id.
    allocationId String
    The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
    bandwidthPackageId String
    The bandwidth package id.
    allocationId string
    The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
    bandwidthPackageId string
    The bandwidth package id.
    allocation_id str
    The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
    bandwidth_package_id str
    The bandwidth package id.
    allocationId String
    The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
    bandwidthPackageId String
    The bandwidth package id.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Attachment Resource

    Get an existing Attachment 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?: AttachmentState, opts?: CustomResourceOptions): Attachment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            allocation_id: Optional[str] = None,
            bandwidth_package_id: Optional[str] = None) -> Attachment
    func GetAttachment(ctx *Context, name string, id IDInput, state *AttachmentState, opts ...ResourceOption) (*Attachment, error)
    public static Attachment Get(string name, Input<string> id, AttachmentState? state, CustomResourceOptions? opts = null)
    public static Attachment get(String name, Output<String> id, AttachmentState 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:
    AllocationId string
    The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
    BandwidthPackageId string
    The bandwidth package id.
    AllocationId string
    The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
    BandwidthPackageId string
    The bandwidth package id.
    allocationId String
    The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
    bandwidthPackageId String
    The bandwidth package id.
    allocationId string
    The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
    bandwidthPackageId string
    The bandwidth package id.
    allocation_id str
    The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
    bandwidth_package_id str
    The bandwidth package id.
    allocationId String
    The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
    bandwidthPackageId String
    The bandwidth package id.

    Import

    BandwidthPackageAttachment can be imported using the bandwidth package id and eip id, e.g.

     $ pulumi import volcengine:bandwidth_package/attachment:Attachment default BandwidthPackageId:EipId
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.23 published on Wednesday, Jan 3, 2024 by Volcengine