1. Packages
  2. Volcengine
  3. API Docs
  4. bandwidth_package
  5. Attachment
Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine

volcengine.bandwidth_package.Attachment

Explore with Pulumi AI

Provides a resource to manage bandwidth package attachment

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@pulumi/volcengine";
import * as volcengine from "@volcengine/pulumi";

const fooAddress = new volcengine.eip.Address("fooAddress", {
    billingType: "PostPaidByBandwidth",
    bandwidth: 1,
    isp: "BGP",
    description: "acc-test",
    projectName: "default",
});
const ipv4BandwidthPackage = new volcengine.bandwidth_package.BandwidthPackage("ipv4BandwidthPackage", {
    bandwidthPackageName: "acc-test-bp",
    billingType: "PostPaidByBandwidth",
    isp: "BGP",
    description: "acc-test",
    bandwidth: 2,
    protocol: "IPv4",
    tags: [{
        key: "k1",
        value: "v1",
    }],
});
const ipv4Attachment = new volcengine.bandwidth_package.Attachment("ipv4Attachment", {
    allocationId: fooAddress.id,
    bandwidthPackageId: ipv4BandwidthPackage.id,
});
const fooZones = volcengine.ecs.Zones({});
const fooImages = volcengine.ecs.Images({
    osType: "Linux",
    visibility: "public",
    instanceTypeId: "ecs.g1.large",
});
const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
    vpcName: "acc-test-vpc",
    cidrBlock: "172.16.0.0/16",
    enableIpv6: true,
});
const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
    subnetName: "acc-test-subnet",
    cidrBlock: "172.16.0.0/24",
    zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
    vpcId: fooVpc.id,
    ipv6CidrBlock: 1,
});
const fooSecurityGroup = new volcengine.vpc.SecurityGroup("fooSecurityGroup", {
    vpcId: fooVpc.id,
    securityGroupName: "acc-test-security-group",
});
const fooIpv6Gateway = new volcengine.vpc.Ipv6Gateway("fooIpv6Gateway", {
    vpcId: fooVpc.id,
    description: "test",
});
const fooInstance = new volcengine.ecs.Instance("fooInstance", {
    imageId: fooImages.then(fooImages => fooImages.images?.[0]?.imageId),
    instanceType: "ecs.g1.large",
    instanceName: "acc-test-ecs-name",
    password: "93f0cb0614Aab12",
    instanceChargeType: "PostPaid",
    systemVolumeType: "ESSD_PL0",
    systemVolumeSize: 40,
    subnetId: fooSubnet.id,
    securityGroupIds: [fooSecurityGroup.id],
    ipv6AddressCount: 1,
});
const fooIpv6Addresses = volcengine.vpc.Ipv6AddressesOutput({
    associatedInstanceId: fooInstance.id,
});
const fooIpv6AddressBandwidth = new volcengine.vpc.Ipv6AddressBandwidth("fooIpv6AddressBandwidth", {
    ipv6Address: fooIpv6Addresses.apply(fooIpv6Addresses => fooIpv6Addresses.ipv6Addresses?.[0]?.ipv6Address),
    billingType: "PostPaidByBandwidth",
    bandwidth: 5,
});
const ipv6 = new volcengine.bandwidth_package.BandwidthPackage("ipv6", {
    bandwidthPackageName: "acc-test-bp",
    billingType: "PostPaidByBandwidth",
    isp: "BGP",
    description: "acc-test",
    bandwidth: 2,
    protocol: "IPv6",
    tags: [{
        key: "k1",
        value: "v1",
    }],
});
const fooAttachment = new volcengine.bandwidth_package.Attachment("fooAttachment", {
    allocationId: fooIpv6AddressBandwidth.id,
    bandwidthPackageId: ipv6.id,
});
Copy
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")
ipv4_bandwidth_package = volcengine.bandwidth_package.BandwidthPackage("ipv4BandwidthPackage",
    bandwidth_package_name="acc-test-bp",
    billing_type="PostPaidByBandwidth",
    isp="BGP",
    description="acc-test",
    bandwidth=2,
    protocol="IPv4",
    tags=[volcengine.bandwidth_package.BandwidthPackageTagArgs(
        key="k1",
        value="v1",
    )])
ipv4_attachment = volcengine.bandwidth_package.Attachment("ipv4Attachment",
    allocation_id=foo_address.id,
    bandwidth_package_id=ipv4_bandwidth_package.id)
foo_zones = volcengine.ecs.zones()
foo_images = volcengine.ecs.images(os_type="Linux",
    visibility="public",
    instance_type_id="ecs.g1.large")
foo_vpc = volcengine.vpc.Vpc("fooVpc",
    vpc_name="acc-test-vpc",
    cidr_block="172.16.0.0/16",
    enable_ipv6=True)
foo_subnet = volcengine.vpc.Subnet("fooSubnet",
    subnet_name="acc-test-subnet",
    cidr_block="172.16.0.0/24",
    zone_id=foo_zones.zones[0].id,
    vpc_id=foo_vpc.id,
    ipv6_cidr_block=1)
foo_security_group = volcengine.vpc.SecurityGroup("fooSecurityGroup",
    vpc_id=foo_vpc.id,
    security_group_name="acc-test-security-group")
foo_ipv6_gateway = volcengine.vpc.Ipv6Gateway("fooIpv6Gateway",
    vpc_id=foo_vpc.id,
    description="test")
foo_instance = volcengine.ecs.Instance("fooInstance",
    image_id=foo_images.images[0].image_id,
    instance_type="ecs.g1.large",
    instance_name="acc-test-ecs-name",
    password="93f0cb0614Aab12",
    instance_charge_type="PostPaid",
    system_volume_type="ESSD_PL0",
    system_volume_size=40,
    subnet_id=foo_subnet.id,
    security_group_ids=[foo_security_group.id],
    ipv6_address_count=1)
foo_ipv6_addresses = volcengine.vpc.ipv6_addresses_output(associated_instance_id=foo_instance.id)
foo_ipv6_address_bandwidth = volcengine.vpc.Ipv6AddressBandwidth("fooIpv6AddressBandwidth",
    ipv6_address=foo_ipv6_addresses.ipv6_addresses[0].ipv6_address,
    billing_type="PostPaidByBandwidth",
    bandwidth=5)
ipv6 = volcengine.bandwidth_package.BandwidthPackage("ipv6",
    bandwidth_package_name="acc-test-bp",
    billing_type="PostPaidByBandwidth",
    isp="BGP",
    description="acc-test",
    bandwidth=2,
    protocol="IPv6",
    tags=[volcengine.bandwidth_package.BandwidthPackageTagArgs(
        key="k1",
        value="v1",
    )])
foo_attachment = volcengine.bandwidth_package.Attachment("fooAttachment",
    allocation_id=foo_ipv6_address_bandwidth.id,
    bandwidth_package_id=ipv6.id)
Copy
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/ecs"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/eip"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
)

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"),
		})
		if err != nil {
			return err
		}
		ipv4BandwidthPackage, err := bandwidth_package.NewBandwidthPackage(ctx, "ipv4BandwidthPackage", &bandwidth_package.BandwidthPackageArgs{
			BandwidthPackageName: pulumi.String("acc-test-bp"),
			BillingType:          pulumi.String("PostPaidByBandwidth"),
			Isp:                  pulumi.String("BGP"),
			Description:          pulumi.String("acc-test"),
			Bandwidth:            pulumi.Int(2),
			Protocol:             pulumi.String("IPv4"),
			Tags: bandwidth_package.BandwidthPackageTagArray{
				&bandwidth_package.BandwidthPackageTagArgs{
					Key:   pulumi.String("k1"),
					Value: pulumi.String("v1"),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = bandwidth_package.NewAttachment(ctx, "ipv4Attachment", &bandwidth_package.AttachmentArgs{
			AllocationId:       fooAddress.ID(),
			BandwidthPackageId: ipv4BandwidthPackage.ID(),
		})
		if err != nil {
			return err
		}
		fooZones, err := ecs.Zones(ctx, nil, nil)
		if err != nil {
			return err
		}
		fooImages, err := ecs.Images(ctx, &ecs.ImagesArgs{
			OsType:         pulumi.StringRef("Linux"),
			Visibility:     pulumi.StringRef("public"),
			InstanceTypeId: pulumi.StringRef("ecs.g1.large"),
		}, nil)
		if err != nil {
			return err
		}
		fooVpc, err := vpc.NewVpc(ctx, "fooVpc", &vpc.VpcArgs{
			VpcName:    pulumi.String("acc-test-vpc"),
			CidrBlock:  pulumi.String("172.16.0.0/16"),
			EnableIpv6: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		fooSubnet, err := vpc.NewSubnet(ctx, "fooSubnet", &vpc.SubnetArgs{
			SubnetName:    pulumi.String("acc-test-subnet"),
			CidrBlock:     pulumi.String("172.16.0.0/24"),
			ZoneId:        pulumi.String(fooZones.Zones[0].Id),
			VpcId:         fooVpc.ID(),
			Ipv6CidrBlock: pulumi.Int(1),
		})
		if err != nil {
			return err
		}
		fooSecurityGroup, err := vpc.NewSecurityGroup(ctx, "fooSecurityGroup", &vpc.SecurityGroupArgs{
			VpcId:             fooVpc.ID(),
			SecurityGroupName: pulumi.String("acc-test-security-group"),
		})
		if err != nil {
			return err
		}
		_, err = vpc.NewIpv6Gateway(ctx, "fooIpv6Gateway", &vpc.Ipv6GatewayArgs{
			VpcId:       fooVpc.ID(),
			Description: pulumi.String("test"),
		})
		if err != nil {
			return err
		}
		fooInstance, err := ecs.NewInstance(ctx, "fooInstance", &ecs.InstanceArgs{
			ImageId:            pulumi.String(fooImages.Images[0].ImageId),
			InstanceType:       pulumi.String("ecs.g1.large"),
			InstanceName:       pulumi.String("acc-test-ecs-name"),
			Password:           pulumi.String("93f0cb0614Aab12"),
			InstanceChargeType: pulumi.String("PostPaid"),
			SystemVolumeType:   pulumi.String("ESSD_PL0"),
			SystemVolumeSize:   pulumi.Int(40),
			SubnetId:           fooSubnet.ID(),
			SecurityGroupIds: pulumi.StringArray{
				fooSecurityGroup.ID(),
			},
			Ipv6AddressCount: pulumi.Int(1),
		})
		if err != nil {
			return err
		}
		fooIpv6Addresses := vpc.Ipv6AddressesOutput(ctx, vpc.Ipv6AddressesOutputArgs{
			AssociatedInstanceId: fooInstance.ID(),
		}, nil)
		fooIpv6AddressBandwidth, err := vpc.NewIpv6AddressBandwidth(ctx, "fooIpv6AddressBandwidth", &vpc.Ipv6AddressBandwidthArgs{
			Ipv6Address: fooIpv6Addresses.ApplyT(func(fooIpv6Addresses vpc.Ipv6AddressesResult) (*string, error) {
				return &fooIpv6Addresses.Ipv6Addresses[0].Ipv6Address, nil
			}).(pulumi.StringPtrOutput),
			BillingType: pulumi.String("PostPaidByBandwidth"),
			Bandwidth:   pulumi.Int(5),
		})
		if err != nil {
			return err
		}
		ipv6, err := bandwidth_package.NewBandwidthPackage(ctx, "ipv6", &bandwidth_package.BandwidthPackageArgs{
			BandwidthPackageName: pulumi.String("acc-test-bp"),
			BillingType:          pulumi.String("PostPaidByBandwidth"),
			Isp:                  pulumi.String("BGP"),
			Description:          pulumi.String("acc-test"),
			Bandwidth:            pulumi.Int(2),
			Protocol:             pulumi.String("IPv6"),
			Tags: bandwidth_package.BandwidthPackageTagArray{
				&bandwidth_package.BandwidthPackageTagArgs{
					Key:   pulumi.String("k1"),
					Value: pulumi.String("v1"),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = bandwidth_package.NewAttachment(ctx, "fooAttachment", &bandwidth_package.AttachmentArgs{
			AllocationId:       fooIpv6AddressBandwidth.ID(),
			BandwidthPackageId: ipv6.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using 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",
    });

    var ipv4BandwidthPackage = new Volcengine.Bandwidth_package.BandwidthPackage("ipv4BandwidthPackage", new()
    {
        BandwidthPackageName = "acc-test-bp",
        BillingType = "PostPaidByBandwidth",
        Isp = "BGP",
        Description = "acc-test",
        Bandwidth = 2,
        Protocol = "IPv4",
        Tags = new[]
        {
            new Volcengine.Bandwidth_package.Inputs.BandwidthPackageTagArgs
            {
                Key = "k1",
                Value = "v1",
            },
        },
    });

    var ipv4Attachment = new Volcengine.Bandwidth_package.Attachment("ipv4Attachment", new()
    {
        AllocationId = fooAddress.Id,
        BandwidthPackageId = ipv4BandwidthPackage.Id,
    });

    var fooZones = Volcengine.Ecs.Zones.Invoke();

    var fooImages = Volcengine.Ecs.Images.Invoke(new()
    {
        OsType = "Linux",
        Visibility = "public",
        InstanceTypeId = "ecs.g1.large",
    });

    var fooVpc = new Volcengine.Vpc.Vpc("fooVpc", new()
    {
        VpcName = "acc-test-vpc",
        CidrBlock = "172.16.0.0/16",
        EnableIpv6 = true,
    });

    var fooSubnet = new Volcengine.Vpc.Subnet("fooSubnet", new()
    {
        SubnetName = "acc-test-subnet",
        CidrBlock = "172.16.0.0/24",
        ZoneId = fooZones.Apply(zonesResult => zonesResult.Zones[0]?.Id),
        VpcId = fooVpc.Id,
        Ipv6CidrBlock = 1,
    });

    var fooSecurityGroup = new Volcengine.Vpc.SecurityGroup("fooSecurityGroup", new()
    {
        VpcId = fooVpc.Id,
        SecurityGroupName = "acc-test-security-group",
    });

    var fooIpv6Gateway = new Volcengine.Vpc.Ipv6Gateway("fooIpv6Gateway", new()
    {
        VpcId = fooVpc.Id,
        Description = "test",
    });

    var fooInstance = new Volcengine.Ecs.Instance("fooInstance", new()
    {
        ImageId = fooImages.Apply(imagesResult => imagesResult.Images[0]?.ImageId),
        InstanceType = "ecs.g1.large",
        InstanceName = "acc-test-ecs-name",
        Password = "93f0cb0614Aab12",
        InstanceChargeType = "PostPaid",
        SystemVolumeType = "ESSD_PL0",
        SystemVolumeSize = 40,
        SubnetId = fooSubnet.Id,
        SecurityGroupIds = new[]
        {
            fooSecurityGroup.Id,
        },
        Ipv6AddressCount = 1,
    });

    var fooIpv6Addresses = Volcengine.Vpc.Ipv6Addresses.Invoke(new()
    {
        AssociatedInstanceId = fooInstance.Id,
    });

    var fooIpv6AddressBandwidth = new Volcengine.Vpc.Ipv6AddressBandwidth("fooIpv6AddressBandwidth", new()
    {
        Ipv6Address = fooIpv6Addresses.Apply(ipv6AddressesResult => ipv6AddressesResult.Ipv6Addresses[0]?.Ipv6Address),
        BillingType = "PostPaidByBandwidth",
        Bandwidth = 5,
    });

    var ipv6 = new Volcengine.Bandwidth_package.BandwidthPackage("ipv6", new()
    {
        BandwidthPackageName = "acc-test-bp",
        BillingType = "PostPaidByBandwidth",
        Isp = "BGP",
        Description = "acc-test",
        Bandwidth = 2,
        Protocol = "IPv6",
        Tags = new[]
        {
            new Volcengine.Bandwidth_package.Inputs.BandwidthPackageTagArgs
            {
                Key = "k1",
                Value = "v1",
            },
        },
    });

    var fooAttachment = new Volcengine.Bandwidth_package.Attachment("fooAttachment", new()
    {
        AllocationId = fooIpv6AddressBandwidth.Id,
        BandwidthPackageId = ipv6.Id,
    });

});
Copy
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 com.pulumi.volcengine.ecs.EcsFunctions;
import com.pulumi.volcengine.ecs.inputs.ZonesArgs;
import com.pulumi.volcengine.ecs.inputs.ImagesArgs;
import com.pulumi.volcengine.vpc.Vpc;
import com.pulumi.volcengine.vpc.VpcArgs;
import com.pulumi.volcengine.vpc.Subnet;
import com.pulumi.volcengine.vpc.SubnetArgs;
import com.pulumi.volcengine.vpc.SecurityGroup;
import com.pulumi.volcengine.vpc.SecurityGroupArgs;
import com.pulumi.volcengine.vpc.Ipv6Gateway;
import com.pulumi.volcengine.vpc.Ipv6GatewayArgs;
import com.pulumi.volcengine.ecs.Instance;
import com.pulumi.volcengine.ecs.InstanceArgs;
import com.pulumi.volcengine.vpc.VpcFunctions;
import com.pulumi.volcengine.vpc.inputs.Ipv6AddressesArgs;
import com.pulumi.volcengine.vpc.Ipv6AddressBandwidth;
import com.pulumi.volcengine.vpc.Ipv6AddressBandwidthArgs;
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")
            .build());

        var ipv4BandwidthPackage = new BandwidthPackage("ipv4BandwidthPackage", BandwidthPackageArgs.builder()        
            .bandwidthPackageName("acc-test-bp")
            .billingType("PostPaidByBandwidth")
            .isp("BGP")
            .description("acc-test")
            .bandwidth(2)
            .protocol("IPv4")
            .tags(BandwidthPackageTagArgs.builder()
                .key("k1")
                .value("v1")
                .build())
            .build());

        var ipv4Attachment = new Attachment("ipv4Attachment", AttachmentArgs.builder()        
            .allocationId(fooAddress.id())
            .bandwidthPackageId(ipv4BandwidthPackage.id())
            .build());

        final var fooZones = EcsFunctions.Zones();

        final var fooImages = EcsFunctions.Images(ImagesArgs.builder()
            .osType("Linux")
            .visibility("public")
            .instanceTypeId("ecs.g1.large")
            .build());

        var fooVpc = new Vpc("fooVpc", VpcArgs.builder()        
            .vpcName("acc-test-vpc")
            .cidrBlock("172.16.0.0/16")
            .enableIpv6(true)
            .build());

        var fooSubnet = new Subnet("fooSubnet", SubnetArgs.builder()        
            .subnetName("acc-test-subnet")
            .cidrBlock("172.16.0.0/24")
            .zoneId(fooZones.applyValue(zonesResult -> zonesResult.zones()[0].id()))
            .vpcId(fooVpc.id())
            .ipv6CidrBlock(1)
            .build());

        var fooSecurityGroup = new SecurityGroup("fooSecurityGroup", SecurityGroupArgs.builder()        
            .vpcId(fooVpc.id())
            .securityGroupName("acc-test-security-group")
            .build());

        var fooIpv6Gateway = new Ipv6Gateway("fooIpv6Gateway", Ipv6GatewayArgs.builder()        
            .vpcId(fooVpc.id())
            .description("test")
            .build());

        var fooInstance = new Instance("fooInstance", InstanceArgs.builder()        
            .imageId(fooImages.applyValue(imagesResult -> imagesResult.images()[0].imageId()))
            .instanceType("ecs.g1.large")
            .instanceName("acc-test-ecs-name")
            .password("93f0cb0614Aab12")
            .instanceChargeType("PostPaid")
            .systemVolumeType("ESSD_PL0")
            .systemVolumeSize(40)
            .subnetId(fooSubnet.id())
            .securityGroupIds(fooSecurityGroup.id())
            .ipv6AddressCount(1)
            .build());

        final var fooIpv6Addresses = VpcFunctions.Ipv6Addresses(Ipv6AddressesArgs.builder()
            .associatedInstanceId(fooInstance.id())
            .build());

        var fooIpv6AddressBandwidth = new Ipv6AddressBandwidth("fooIpv6AddressBandwidth", Ipv6AddressBandwidthArgs.builder()        
            .ipv6Address(fooIpv6Addresses.applyValue(ipv6AddressesResult -> ipv6AddressesResult).applyValue(fooIpv6Addresses -> fooIpv6Addresses.applyValue(ipv6AddressesResult -> ipv6AddressesResult.ipv6Addresses()[0].ipv6Address())))
            .billingType("PostPaidByBandwidth")
            .bandwidth(5)
            .build());

        var ipv6 = new BandwidthPackage("ipv6", BandwidthPackageArgs.builder()        
            .bandwidthPackageName("acc-test-bp")
            .billingType("PostPaidByBandwidth")
            .isp("BGP")
            .description("acc-test")
            .bandwidth(2)
            .protocol("IPv6")
            .tags(BandwidthPackageTagArgs.builder()
                .key("k1")
                .value("v1")
                .build())
            .build());

        var fooAttachment = new Attachment("fooAttachment", AttachmentArgs.builder()        
            .allocationId(fooIpv6AddressBandwidth.id())
            .bandwidthPackageId(ipv6.id())
            .build());

    }
}
Copy
resources:
  fooAddress:
    type: volcengine:eip:Address
    properties:
      billingType: PostPaidByBandwidth
      bandwidth: 1
      isp: BGP
      description: acc-test
      projectName: default
  ipv4BandwidthPackage:
    type: volcengine:bandwidth_package:BandwidthPackage
    properties:
      bandwidthPackageName: acc-test-bp
      billingType: PostPaidByBandwidth
      isp: BGP
      description: acc-test
      bandwidth: 2
      protocol: IPv4
      tags:
        - key: k1
          value: v1
  ipv4Attachment:
    type: volcengine:bandwidth_package:Attachment
    properties:
      allocationId: ${fooAddress.id}
      bandwidthPackageId: ${ipv4BandwidthPackage.id}
  fooVpc:
    type: volcengine:vpc:Vpc
    properties:
      vpcName: acc-test-vpc
      cidrBlock: 172.16.0.0/16
      enableIpv6: true
  fooSubnet:
    type: volcengine:vpc:Subnet
    properties:
      subnetName: acc-test-subnet
      cidrBlock: 172.16.0.0/24
      zoneId: ${fooZones.zones[0].id}
      vpcId: ${fooVpc.id}
      ipv6CidrBlock: 1
  fooSecurityGroup:
    type: volcengine:vpc:SecurityGroup
    properties:
      vpcId: ${fooVpc.id}
      securityGroupName: acc-test-security-group
  fooIpv6Gateway:
    type: volcengine:vpc:Ipv6Gateway
    properties:
      vpcId: ${fooVpc.id}
      description: test
  fooInstance:
    type: volcengine:ecs:Instance
    properties:
      imageId: ${fooImages.images[0].imageId}
      instanceType: ecs.g1.large
      instanceName: acc-test-ecs-name
      password: 93f0cb0614Aab12
      instanceChargeType: PostPaid
      systemVolumeType: ESSD_PL0
      systemVolumeSize: 40
      subnetId: ${fooSubnet.id}
      securityGroupIds:
        - ${fooSecurityGroup.id}
      ipv6AddressCount: 1
  fooIpv6AddressBandwidth:
    type: volcengine:vpc:Ipv6AddressBandwidth
    properties:
      ipv6Address: ${fooIpv6Addresses.ipv6Addresses[0].ipv6Address}
      billingType: PostPaidByBandwidth
      bandwidth: 5
  ipv6:
    type: volcengine:bandwidth_package:BandwidthPackage
    properties:
      bandwidthPackageName: acc-test-bp
      billingType: PostPaidByBandwidth
      isp: BGP
      description: acc-test
      bandwidth: 2
      protocol: IPv6
      tags:
        - key: k1
          value: v1
  fooAttachment:
    type: volcengine:bandwidth_package:Attachment
    properties:
      allocationId: ${fooIpv6AddressBandwidth.id}
      bandwidthPackageId: ${ipv6.id}
variables:
  fooZones:
    fn::invoke:
      Function: volcengine:ecs:Zones
      Arguments: {}
  fooImages:
    fn::invoke:
      Function: volcengine:ecs:Images
      Arguments:
        osType: Linux
        visibility: public
        instanceTypeId: ecs.g1.large
  fooIpv6Addresses:
    fn::invoke:
      Function: volcengine:vpc:Ipv6Addresses
      Arguments:
        associatedInstanceId: ${fooInstance.id}
Copy

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 This property is required. string
The unique name of the resource.
args This property is required. AttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. AttachmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. AttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. AttachmentArgs
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 attachmentResource = new Volcengine.Bandwidth_package.Attachment("attachmentResource", new()
{
    AllocationId = "string",
    BandwidthPackageId = "string",
});
Copy
example, err := bandwidth_package.NewAttachment(ctx, "attachmentResource", &bandwidth_package.AttachmentArgs{
	AllocationId:       pulumi.String("string"),
	BandwidthPackageId: pulumi.String("string"),
})
Copy
var attachmentResource = new Attachment("attachmentResource", AttachmentArgs.builder()
    .allocationId("string")
    .bandwidthPackageId("string")
    .build());
Copy
attachment_resource = volcengine.bandwidth_package.Attachment("attachmentResource",
    allocation_id="string",
    bandwidth_package_id="string")
Copy
const attachmentResource = new volcengine.bandwidth_package.Attachment("attachmentResource", {
    allocationId: "string",
    bandwidthPackageId: "string",
});
Copy
type: volcengine:bandwidth_package:Attachment
properties:
    allocationId: string
    bandwidthPackageId: string
Copy

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

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Attachment resource accepts the following input properties:

AllocationId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
BandwidthPackageId
This property is required.
Changes to this property will trigger replacement.
string
The bandwidth package id.
AllocationId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
BandwidthPackageId
This property is required.
Changes to this property will trigger replacement.
string
The bandwidth package id.
allocationId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
bandwidthPackageId
This property is required.
Changes to this property will trigger replacement.
String
The bandwidth package id.
allocationId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
bandwidthPackageId
This property is required.
Changes to this property will trigger replacement.
string
The bandwidth package id.
allocation_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
bandwidth_package_id
This property is required.
Changes to this property will trigger replacement.
str
The bandwidth package id.
allocationId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
bandwidthPackageId
This property is required.
Changes to this property will trigger replacement.
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)
resources:  _:    type: volcengine:bandwidth_package:Attachment    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. string
The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
BandwidthPackageId Changes to this property will trigger replacement. string
The bandwidth package id.
AllocationId Changes to this property will trigger replacement. string
The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
BandwidthPackageId Changes to this property will trigger replacement. string
The bandwidth package id.
allocationId Changes to this property will trigger replacement. String
The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
bandwidthPackageId Changes to this property will trigger replacement. String
The bandwidth package id.
allocationId Changes to this property will trigger replacement. string
The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
bandwidthPackageId Changes to this property will trigger replacement. string
The bandwidth package id.
allocation_id Changes to this property will trigger replacement. str
The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
bandwidth_package_id Changes to this property will trigger replacement. str
The bandwidth package id.
allocationId Changes to this property will trigger replacement. String
The ID of the public IP or IPv6 public bandwidth to be added to the shared bandwidth package instance.
bandwidthPackageId Changes to this property will trigger replacement. 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
Copy

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.