baiducloud

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2020 License: MPL-2.0 Imports: 44 Imported by: 0

Documentation

Overview

Use this data source to query ACL list.

Example Usage

```hcl

data "baiducloud_acls" "default" {
 vpc_id = "vpc-y4p102r3mz6m"
}
output "acls" {
 value = "${data.baiducloud_acls.default.acls}"
}

```

Use this data source to query APPBLB Listener list.

Example Usage

```hcl

data "baiducloud_appblb_listeners" "default" {
 blb_id = "lb-0d29a3f6"
}
output "listeners" {
 value = "${data.baiducloud_appblb_listeners.default.listeners}"
}

```

Use this data source to query APPBLB Server Group list.

Example Usage

```hcl

data "baiducloud_appblb_server_groups" "default" {
 name = "testServerGroup"
}
output "server_groups" {
 value = "${data.baiducloud_appblb_server_groups.default.server_groups}"
}

```

Use this data source to query APPBLB list.

Example Usage

```hcl

data "baiducloud_appblbs" "default" {
 name = "myLoadBalance"
}
output "blbs" {
 value = "${data.baiducloud_appblbs.default.blbs}"
}

```

Use this data source to query Auto Snapshot Policy list.

Example Usage

```hcl data "baiducloud_auto_snapshot_policies" "default" {}

output "auto_snapshot_policiess" {
 value = "${data.baiducloud_auto_snapshot_policies.default.auto_snapshot_policies}"
}

```

Use this data source to query BOS bucket object list.

Example Usage

```hcl

data "baiducloud_bos_bucket_objects" "default" {
  bucket = "my-bucket"
}
output "objects" {
  value = "${data.baiducloud_bos_bucket_objects.default.objects}"
}

```

Use this data source to query BOS bucket list.

Example Usage

```hcl data "baiducloud_bos_buckets" "default" {}

output "buckets" {
 value = "${data.baiducloud_bos_buckets.default.buckets}"
}

```

Use this data source to get cce cluster nodes.

Example Usage

```hcl

data "baiducloud_cce_cluster_nodes" "default" {
   cluster_uuid	 = "c-NqYwWEhu"
}
output "nodes" {
 value = "${data.baiducloud_cce_cluster_nodes.default.nodes}"
}

```

Use this data source to get cce container network.

Example Usage

```hcl

data "baiducloud_cce_container_net" "default" {
	vpc_id   = "vpc-t6d16myuuqyu"
	vpc_cidr = "192.168.0.0/20"
}
output "net" {
  value = "${data.baiducloud_cce_container_net.default.container_net}"
}

```

Use this data source to get cce kubeconfig.

Example Usage

```hcl

data "baiducloud_cce_kubeconfig" "default" {
	cluster_uuid = "c-NqYwWEhu"
}
output "kubeconfig" {
  value = "${data.baiducloud_cce_kubeconfig.default.data}"
}

```

Use this data source to list cce support kubernetes versions.

Example Usage

```hcl data "baiducloud_cce_versions" "default" {}

output "versions" {
  value = "${data.baiducloud_cce_versions.default.versions}"
}

```

Use this data source to list instances of a cluster.

Example Usage

```hcl

data "baiducloud_ccev2_cluster_instances" "default" {
  cluster_id = baiducloud_ccev2_cluster.default_custom.id
  keyword_type = "instanceName"
  keyword = ""
  order_by = "instanceName"
  order = "ASC"
  page_no = 0
  page_size = 0
}

```

Use this data source to recommend ccev2 cluster IP CIDR.

Example Usage

```hcl

data "baiducloud_ccev2_clusterip_cidr" "default" {
  vpc_cidr = var.vpc_cidr
  container_cidr = var.container_cidr
  cluster_max_service_num = 32
  private_net_cidrs = ["172.16.0.0/12",]
  ip_version = "ipv4"
  output_file = "${path.cwd}/recommendClusterIPCidr.txt"
}

```

Use this data source to recommend ccev2 container CIDR.

Example Usage

```hcl

data "baiducloud_ccev2_container_cidr" "default" {
  vpc_id = var.vpc_id
  vpc_cidr = var.vpc_cidr
  cluster_max_node_num = 16
  max_pods_per_node = 32
  private_net_cidrs = ["172.16.0.0/12",]
  k8s_version = "1.16.8"
  ip_version = "ipv4"
  output_file = "${path.cwd}/recommendContainerCidr.txt"
}

```

Use this data source to list instances of a instancegroup.

Example Usage

```hcl

data "baiducloud_ccev2_instance_group_instances" "default" {
  cluster_id = baiducloud_ccev2_cluster.default_custom.id
  instance_group_id = baiducloud_ccev2_instance_group.ccev2_instance_group_1.id
  page_no = 0
  page_size = 0
}

```

Use this data source to query CDS list.

Example Usage

```hcl data "baiducloud_cdss" "default" {}

output "cdss" {
 value = "${data.baiducloud_cdss.default.cdss}"
}

```

Use this data source to query CERT list.

Example Usage

```hcl

data "baiducloud_certs" "default" {
  name = "testCert"
}
output "certs" {
 value = "${data.baiducloud_certs.default.certs}"
}

```

Use this data source to get a function.

Example Usage

```hcl

data "baiducloud_cfc_function" "default" {
   function_name = "terraform-create"
}
output "function" {
 value = "${data.baiducloud_cfc_function.default}"
}

```

Use this data source to query DTS list.

Example Usage

```hcl data "baiducloud_dtss" "default" {}

output "dtss" {
 value = "${data.baiducloud_dtss.default.dtss}"
}

```

Use this data source to query EIP list.

Example Usage

```hcl data "baiducloud_eips" "default" {}

output "eips" {
 value = "${data.baiducloud_eips.default.eips}"
}

```

Use this data source to query image list.

Example Usage

```hcl data "baiducloud_images" "default" {}

output "images" {
  value = "${data.baiducloud_images.default.images}"
}

```

Use this data source to query BCC Instance list.

Example Usage

```hcl data "baiducloud_instances" "default" {}

output "instances" {
 value = "${data.baiducloud_instances.default.instances}"
}

```

Use this data source to query NAT gateway list.

Example Usage

```hcl

data "baiducloud_nat_gateways" "default" {
 vpc_id = "vpc-y4p102r3mz6m"
}
output "nat_gateways" {
 value = "${data.baiducloud_nat_gateways.default.nat_gateways}"
}

```

Use this data source to query Peer Conn list.

Example Usage

```hcl

data "baiducloud_peer_conns" "default" {
  vpc_id = "vpc-y4p102r3mz6m"
}
output "peer_conns" {
  value = "${data.baiducloud_peer_conns.default.peer_conns}"
}

```

Use this data source to query RDS list.

Example Usage

```hcl data "baiducloud_rdss" "default" {}

output "rdss" {
 value = "${data.baiducloud_rdss.default.rdss}"
}

```

Use this data source to query route rule list.

Example Usage

```hcl

data "baiducloud_route_rules" "default" {
 vpc_id = "vpc-y4p102r3mz6m"
}
output "route_rules" {
 value = "${data.baiducloud_route_rules.default.route_rules}"
}

```

Use this data source to query scs specs list.

Example Usage

```hcl data "data.baiducloud_scs_specs" "default" {}

output "specs" {
  value = "${data.baiducloud_scs_specs.default.specs}"
}

```

Use this data source to query SCS list.

Example Usage

```hcl data "baiducloud_scss" "default" {}

output "scss" {
 value = "${data.baiducloud_scss.default.scss}"
}

```

Use this data source to query Security Group list.

Example Usage

```hcl data "baiducloud_security_group_rules" "default" {}

output "security_group_rules" {
 value = "${data.baiducloud_security_group_rules.default.rules}"
}

```

Use this data source to query Security Group list.

Example Usage

```hcl data "baiducloud_security_groups" "default" {}

output "security_groups" {
 value = "${data.baiducloud_security_groups.default.security_groups}"
}

```

Use this data source to query Snapshot list.

Example Usage

```hcl data "baiducloud_snapshots" "default" {}

output "snapshots" {
 value = "${data.baiducloud_snapshots.default.snapshots}"
}

```

Use this data source to query spec list.

Example Usage

```hcl data "baiducloud_specs" "default" {}

output "spec" {
  value = "${data.baiducloud_specs.default.specs}"
}

```

Use this data source to query subnet list.

Example Usage

```hcl

data "baiducloud_subnets" "default" {
 vpc_id = "vpc-y4p102r3mz6m"
}
output "subnets" {
 value = "${data.baiducloud_subnets.default.subnets}"
}

```

Use this data source to query vpc list.

Example Usage

```hcl

data "baiducloud_vpcs" "default" {
    name="test-vpc"
}
output "cidr" {
  value = "${data.baiducloud_vpcs.default.vpcs.0.cidr}"
}

```

Use this data source to query zone list.

Example Usage

```hcl data "baiducloud_zones" "default" {}

output "zone" {
  value = "${data.baiducloud_zones.default.zones}"
}

```

The BaiduCloud provider is used to interact with many resources supported by BaiduCloud. The provider needs to be configured with the proper credentials before it can be used.

The BaiduCloud provider is used to interact with the many resources supported by [BaiduCloud](https://cloud.baidu.com). The provider needs to be configured with the proper credentials before it can be used.

Use the navigation to the left to read about the available resources.

Example Usage

```hcl # Configure the BaiduCloud Provider

provider "baiducloud" {
  access_key  = "${var.access_key}"
  secret_key = "${var.secret_key}"
  region     = "${var.region}"
}

```

Resources List

Data Sources

baiducloud_vpcs
baiducloud_subnets
baiducloud_route_rules
baiducloud_acls
baiducloud_nat_gateways
baiducloud_peer_conns
baiducloud_bos_buckets
baiducloud_bos_bucket_objects
baiducloud_appblbs
baiducloud_appblb_listeners
baiducloud_appblb_server_groups
baiducloud_eips
baiducloud_instances
baiducloud_cdss
baiducloud_security_groups
baiducloud_security_group_rules
baiducloud_snapshots
baiducloud_auto_snapshot_policies
baiducloud_zones
baiducloud_specs
baiducloud_images
baiducloud_certs
baiducloud_cfc_function
baiducloud_scs_specs
baiducloud_scss
baiducloud_cce_versions
baiducloud_cce_container_net
baiducloud_cce_cluster_nodes
baiducloud_cce_kubeconfig
baiducloud_ccev2_container_cidr
baiducloud_ccev2_clusterip_cidr
baiducloud_ccev2_cluster_instances
baiducloud_ccev2_instance_group_instances
baiducloud_dtss

CERT Resources

baiducloud_cert

EIP Resources

baiducloud_eip
baiducloud_eip_association

APPBLB Resources

baiducloud_appblb
baiducloud_appblb_server_group
baiducloud_appblb_listener

BCC Resources

baiducloud_instance
baiducloud_security_group
baiducloud_security_group_rule
baiducloud_cds
baiducloud_cds_attachment
baiducloud_snapshot
baiducloud_auto_snapshot_policy

VPC Resources

baiducloud_vpc
baiducloud_subnet
baiducloud_route_rule
baiducloud_acl
baiducloud_nat_gateway
baiducloud_peer_conn
baiducloud_peer_conn_acceptor

BOS Resources

baiducloud_bos_bucket
baiducloud_bos_bucket_object

CFC Resources

baiducloud_cfc_function
baiducloud_cfc_alias
baiducloud_cfc_trigger
baiducloud_cfc_version

SCS Resources

baiducloud_scs

DTS Resources

baiducloud_dts

CCE Resources

baiducloud_cce_cluster

CCEv2 Resources

baiducloud_ccev2_cluster
baiducloud_ccev2_instance_group

Provide a resource to create an ACL Rule.

Example Usage

```hcl

resource "baiducloud_acl" "default" {
  subnet_id = "sbn-86c3v6pnt8b4"
  protocol = "tcp"
  source_ip_address = "192.168.0.0/24"
  destination_ip_address = "192.168.1.0/24"
  source_port = "8888"
  destination_port = "9999"
  position = 20
  direction = "ingress"
  action = "allow"
}

```

Provide a resource to create an APPBLB.

Example Usage

```hcl

resource "baiducloud_appblb" "default" {
  name        = "testLoadBalance"
  description = "this is a test LoadBalance instance"
  vpc_id      = "vpc-gxaava4knqr1"
  subnet_id   = "sbn-m4x3f2i6c901"

  tags = {
    "tagAKey" = "tagAValue"
    "tagBKey" = "tagBValue"
  }
}

```

Import

APPBLB can be imported, e.g.

```hcl $ terraform import baiducloud_appblb.default id ```

Provide a resource to create an APPBLB Listener.

Example Usage

```hcl TCP/UDP Listener

resource "baiducloud_appblb_listener" "default" {
  blb_id               = "lb-0d29a3f6"
  listener_port        = 124
  protocol             = "TCP"
  scheduler            = "LeastConnection"
}

HTTP Listener

resource "baiducloud_appblb_listener" "default" {
  blb_id        = "lb-0d29a3f6"
  listener_port = 129
  protocol      = "HTTP"
  scheduler     = "RoundRobin"
  keep_session  = true

  policies {
    description         = "acceptance test"
    app_server_group_id = "sg-11bd8054"
    backend_port        = 70
    priority            = 50

    rule_list {
      key   = "host"
      value = "baidu.com"
    }
  }
}

HTTPS Listener

resource "baiducloud_appblb_listener" "default" {
  blb_id               = "lb-0d29a3f6"
  listener_port        = 130
  protocol             = "HTTPS"
  scheduler            = "LeastConnection"
  keep_session         = true
  cert_ids             = ["cert-xvysj80uif1y"]
  encryption_protocols = ["sslv3", "tlsv10", "tlsv11"]
  encryption_type      = "userDefind"
}

SSL Listener

resource "baiducloud_appblb_listener" "default" {
  blb_id               = "lb-0d29a3f6"
  listener_port        = 131
  protocol             = "SSL"
  scheduler            = "LeastConnection"
  cert_ids             = ["cert-xvysj80uif1y"]
  encryption_protocols = ["sslv3", "tlsv10", "tlsv11"]
  encryption_type      = "userDefind"
}

```

Provide a resource to create an APPBLB Server Group.

Example Usage

```hcl

resource "baiducloud_appblb_server_group" "default" {
  name        = "testServerGroup"
  description = "this is a test Server Group"
  blb_id      = "lb-0d29a3f6"

  backend_server_list {
    instance_id = "i-VRKxC21a"
    weight = 50
  }

  port_list {
    port = 66
    type = "TCP"
  }
}

```

Provide a resource to create an AutoSnapshotPolicy.

Example Usage

```hcl

resource "baiducloud_auto_snapshot_policy" "my-asp" {
  name            = "${var.name}"
  time_points     = [0, 22]
  repeat_weekdays = [0, 3]
  retention_days  = -1
  volume_ids      = ["v-Trb3rQXa"]
}

```

Import

AutoSnapshotPolicy can be imported, e.g.

```hcl $ terraform import baiducloud_auto_snapshot_policy.default id ```

Provide a resource to create a BOS Bucket.

Example Usage

```hcl Private bucket

resource "baiducloud_bos_bucket" "default" {
  bucket = "${var.bucket}"
  acl = "private"
}

```

Using replication configuration ```hcl

resource "baiducloud_bos_bucket" "default" {
  bucket = "${var.bucket}"

  replication_configuration {
    id = "test-rc"
    status = "enabled"
    resource = ["test-terraform/abc*"]
    destination {
      bucket = "test-terraform"
    }
    replicate_deletes = "disabled"
  }
}

```

Using logging ```hcl

resource "baiducloud_bos_bucket" "default" {
  bucket = "${var.bucket}"

  logging {
    target_bucket = "test-terraform"
    target_prefix = "logs/"
  }
}

```

Using lifecycle rule ```hcl

resource "baiducloud_bos_bucket" "default" {
  bucket = "${var.bucket}"

  lifecycle_rule {
	id = "test-id01"
	status =  "enabled"
	resource = ["test-terraform/abc*"]
	condition {
	  time {
	   date_greater_than = "2019-09-07T00:00:00Z"
	  }
	}
	action {
	  name = "DeleteObject"
	}
  }
  lifecycle_rule {
	id = "test-id02"
	status =  "enabled"
	resource = ["test-terraform/def*"]
	condition {
	  time {
	   date_greater_than = "$(lastModified)+P7D"
	  }
	}
	action {
	  name = "DeleteObject"
	}
  }
}

```

Using website ```hcl

resource "baiducloud_bos_bucket" "default" {
  bucket = "${var.bucket}"

  website{
    index_document = "index.html"
    error_document = "err.html"
  }
}

```

Using cors rule ```hcl

resource "baiducloud_bos_bucket" "default" {
  bucket = "${var.bucket}"

  cors_rule {
    allowed_origins = ["https://www.baidu.com"]
    allowed_methods = ["GET"]
    max_age_seconds = 1800
  }
}

```

Using copyright protection ```hcl

resource "baiducloud_bos_bucket" "default" {
  bucket = "${var.bucket}"

  copyright_protection {
    resource = ["test-terraform/abc*"]
  }
}

```

Import

BOS bucket can be imported, e.g.

```hcl $ terraform import baiducloud_bos_bucket.default bucket_id ```

Provide a resource to create a BOS bucket object.

Example Usage

```hcl

resource "baiducloud_bos_bucket_object" "default" {
  bucket = "my-bucket"
  key = "test-key"
  source = "/tmp/test-file"
  acl = "public-read"
}

```

Use this resource to get information about a CCE Cluster.

~> **NOTE:** The terminate operation of cce does NOT take effect immediately,maybe takes for several minites.

Example Usage

```hcl

resource "baiducloud_cce_cluster" "my-cluster" {
  cluster_name        = "test-cce-cluster"
  main_available_zone = "zoneA"
  container_net       = "172.16.0.0/16"
  deploy_mode		  = "BCC"
  master_config {
    instance_type     = "10"
    cpu               = 4
    memory            = 8
    image_type        = "common"
    logical_zone      = "zoneA"
    subnet_uuid       = baiducloud_subnet.defaultA.id
    security_group_id = baiducloud_security_group.defualt.id
    product_type      = "postpay"
    image_id          = data.baiducloud_images.default.images.0.id
  }
  worker_config {
    count = {
      "zoneA" : 2
    }
    instance_type = "10"
    cpu           = 1
    memory        = 2
    subnet_uuid = {
      "zoneA" : baiducloud_subnet.defaultA.id
      "zoneB" : baiducloud_subnet.defaultB.id
    }
    security_group_id = baiducloud_security_group.defualt.id
    product_type      = "postpay"
    image_id          = data.baiducloud_images.default.images.0.id
  }
}

```

Use this resource to create a CCEv2 cluster.

Example Usage

```hcl

resource "baiducloud_ccev2_cluster" "default_managed" {
  cluster_spec  {
    cluster_name = var.cluster_name
    cluster_type = "normal"
    k8s_version = "1.16.8"
    runtime_type = "docker"
    vpc_id = baiducloud_vpc.default.id
    plugins = ["core-dns", "kube-proxy"]
    master_config {
      master_type = "managed"
      cluster_ha = 2
      exposed_public = false
      cluster_blb_vpc_subnet_id = baiducloud_subnet.defaultA.id
      managed_cluster_master_option {
        master_vpc_subnet_zone = "zoneA"
      }
    }
    container_network_config  {
      mode = "kubenet"
      lb_service_vpc_subnet_id = baiducloud_subnet.defaultA.id
      node_port_range_min = 30000
      node_port_range_max = 32767
      max_pods_per_node = 64
      cluster_pod_cidr = var.cluster_pod_cidr
      cluster_ip_service_cidr = var.cluster_ip_service_cidr
      ip_version = "ipv4"
      kube_proxy_mode = "iptables"
    }
    cluster_delete_option {
      delete_resource = true
      delete_cds_snapshot = true
    }
  }
}

```

Use this resource to create a CCEv2 InstanceGroup.

~> **NOTE:** The create/update/delete operation of ccev2 does NOT take effect immediately,maybe takes for several minutes.

Example Usage

```hcl

resource "baiducloud_ccev2_instance_group" "ccev2_instance_group_1" {
  spec {
    cluster_id = baiducloud_ccev2_cluster.default_custom.id
    replicas = var.instance_group_replica_1
    instance_group_name = "ig_1"
    instance_template {
      cce_instance_id = ""
      instance_name = "tf_ins_ig_1"
      cluster_role = "node"
      existed = false
      machine_type = "BCC"
      instance_type = "N3"
      vpc_config {
        vpc_id = baiducloud_vpc.default.id
        vpc_subnet_id = baiducloud_subnet.defaultA.id
        security_group_id = baiducloud_security_group.default.id
        available_zone = "zoneA"
      }
      deploy_custom_config {
        pre_user_script  = "ls"
        post_user_script = "date"
      }
      instance_resource {
        cpu = 4
        mem = 8
        root_disk_size = 40
        local_disk_size = 0
      }
      image_id = data.baiducloud_images.default.images.0.id
      instance_os {
        image_type = "System"
      }
      need_eip = false
      admin_password = "test123!YT"
      ssh_key_id = ""
      instance_charging_type = "Postpaid"
      runtime_type = "docker"
    }
  }
}

```

Provide a resource to create a CDS.

Example Usage

```hcl

resource "baiducloud_cds" "default" {
  name                    = "terraformCreate"
  description             = "terraform create cds"
  payment_timing          = "Postpaid"
  auto_snapshot_policy_id = "asp-xyYk0XFC"
  snapshot_id             = "s-WTGlKBR1"
}

```

Import

CDS can be imported, e.g.

```hcl $ terraform import baiducloud_cds.default id ```

Provide a resource to create a CDS attachment, can attach a CDS volume with instance.

Example Usage

```hcl

resource "baiducloud_cds_attachment" "default" {
  cds_id      = "v-FJjJeTiG"
  instance_id = "i-tgZhS50C"
}

```

Import

CDS attachment can be imported, e.g.

```hcl $ terraform import baiducloud_cds_attachment.default id ```

Provide a resource to Upload a cert.

Example Usage

```hcl

resource "baiducloud_cert" "cert" {
  cert_name         = "testCert"
  cert_server_data  = ""
  cert_private_data = ""
}

```

Provide a resource to create a CFC Function Alias.

Example Usage

```hcl

resource "baiducloud_cfc_alias" "default" {
  function_name    = "terraform-cfc"
  function_version = "$LATEST"
  alias_name       = "terraformAlias"
  description      = "terraform create alias"
}

```

```

Provide a resource to create an CFC Function.

Example Usage

```hcl

resource "baiducloud_cfc_function" "default" {
  function_name  = "terraform-cfc"
  description    = "terraform create"
  handler        = "index.handler"
  memory_size    = 256
  runtime        = "nodejs12"
  time_out       = 20
  code_file_name = "../../baiducloud/testFiles/cfcTestCode.zip"
}

```

Import

CFC can be imported, e.g.

```hcl $ terraform import baiducloud_cfc_function.default functionName ```

Provide a resource to create a CFC Function Trigger.

Example Usage

```hcl

resource "baiducloud_cfc_trigger" "http-trigger" {
  source_type   = "cfc-http-trigger/v1/CFCAPI"
  target        = "function_brn"
  resource_path = "/aaabbs"
  method        = ["GET","PUT"]
  auth_type     = "iam"
}

```

```

Provide a resource to publish a CFC Function Version.

Example Usage

```hcl

resource "baiducloud_cfc_version" "default" {
  function_name       = "terraform-cfc"
  version_description = "terraformVersion"
}

```

```

Provide a resource to create a DTS.

Example Usage

```hcl

resource "baiducloud_dts" "default" {
    product_type         = "postpay"
	type                 = "migration"
	standard             = "Large"
	source_instance_type = "public"
	target_instance_type = "public"
	cross_region_tag     = 0

    task_name            = "taskname"
	data_type			 = ["schema","base"]
    src_connection = {
        region          = "public"
		db_type			= "mysql"
		db_user			= "baidu"
		db_pass			= "password"
		db_port			= 3306
		db_host			= "106.12.174.191"
		instance_id		= "rds-lNy3KsQQ"
		instance_type	= "public"
    }
	dst_connection = {
        region          = "public"
		db_type			= "mysql"
		db_user			= "baidu"
		db_pass			= "password"
		db_port			= 3306
		db_host			= "106.12.174.191"
		instance_id		= "rds-lNy3KsQQ"
		instance_type	= "public"
    }
    schema_mapping {
			type        = "db"
			src			= "db1"
			dst			= "db2"
			where		= ""
	}
}

```

Import

DTS can be imported, e.g.

```hcl $ terraform import baiducloud_dts.default dts ```

Provide a resource to create an EIP.

Example Usage

```hcl

resource "baiducloud_eip" "default" {
  name              = "testEIP"
  bandwidth_in_mbps = 100
  payment_timing    = "Postpaid"
  billing_method    = "ByTraffic"
}

```

Import

EIP can be imported, e.g.

```hcl $ terraform import baiducloud_eip.default eip ```

Provide a resource to create an EIP association, bind an EIP with instance.

Example Usage

```hcl

resource "baiducloud_eip_association" "default" {
  eip           = "1.1.1.1"
  instance_type = "BCC"
  instance_id   = "i-7xc9Q6KR"
}

```

Import

EIP association can be imported, e.g.

```hcl $ terraform import baiducloud_eip_association.default eip ```

Use this resource to get information about a BCC instance.

~> **NOTE:** The terminate operation of bcc does NOT take effect immediately,maybe takes for several minites.

Example Usage

```hcl

resource "baiducloud_instance" "my-server" {
  image_id = "m-A4jJpFzi"
  name = "my-instance"
  availability_zone = "cn-bj-a"
  cpu_count = "2"
  memory_capacity_in_gb = "8"
  billing = {
    payment_timing = "Postpaid"
  }
}

```

Import

BCC instance can be imported, e.g.

```hcl $ terraform import baiducloud_instance.my-server id ```

Provide a resource to create a NAT Gateway.

Example Usage

```hcl

resource "baiducloud_nat_gateway" "default" {
  name = "terraform-nat-gateway"
  vpc_id = "vpc-ggm7drdgyvha"
  spec = "medium"
  billing = {
    payment_timing = "Postpaid"
  }
}

```

Import

NAT Gateway instance can be imported, e.g.

```hcl $ terraform import baiducloud_nat_gateway.default nat_gateway_id ```

Provide a resource to create a Peer Conn.

Example Usage

```hcl

resource "baiducloud_peer_conn" "default" {
  bandwidth_in_mbps = 10
  local_vpc_id = "vpc-y4p102r3mz6m"
  peer_vpc_id = "vpc-4njbqurm0uag"
  peer_region = "bj"
  billing = {
    payment_timing = "Postpaid"
  }
}

```

Import

Peer Conn instance can be imported, e.g.

```hcl $ terraform import baiducloud_peer_conn.default peer_conn_id ```

Provide a resource to create a Peer Conn Acceptor.

Example Usage

```hcl

resource "baiducloud_peer_conn" "default" {
  bandwidth_in_mbps = 10
  local_vpc_id = "vpc-y4p102r3mz6m"
  peer_vpc_id = "vpc-4njbqurm0uag"
  peer_region = "bj"
  billing = {
    payment_timing = "Postpaid"
  }
}
resource "baiducloud_peer_conn_acceptor" "default" {
  peer_conn_id = "${baiducloud_peer_conn.default.id}"
  auto_accept = true
  dns_sync = true
}

```

Import

Peer Conn Acceptor instance can be imported, e.g.

```hcl $ terraform import baiducloud_peer_conn_acceptor.default peer_conn_id ```

Use this resource to get information about a RDS Account.

Example Usage

```hcl resource "baiducloud_rds_account" "default" { } ```

Import

RDS Account can be imported, e.g.

```hcl $ terraform import baiducloud_rds_account.default id ```

Use this resource to get information about a RDS instance.

~> **NOTE:** The terminate operation of rds instance does NOT take effect immediately,maybe takes for several minites.

Example Usage

```hcl

resource "baiducloud_rds_instance" "default" {
    billing = {
        payment_timing        = "Postpaid"
    }
    engine_version            = "5.6"
    engine                    = "MySQL"
    cpu_count                 = 1
    memory_capacity           = 1
    volume_capacity           = 5
}

```

Import

RDS instance can be imported, e.g.

```hcl $ terraform import baiducloud_rds_instance.default id ```

Use this resource to get information about a RDS readonly instance.

~> **NOTE:** The terminate operation of rds readonly instance does NOT take effect immediately,maybe takes for several minites.

Example Usage

```hcl

resource "baiducloud_rds_readonly_instance" "default" {
    billing = {
        payment_timing        = "Postpaid"
    }
    source_instance_id        = baiducloud_rds_instance.default.instance_id
    cpu_count                 = 1
    memory_capacity           = 1
    volume_capacity           = 5
}

```

Import

RDS readonly instance can be imported, e.g.

```hcl $ terraform import baiducloud_rds_readonly_instance.default id ```

Provides a resource to create a VPC routing rule.

Example Usage

```hcl

resource "baiducloud_route_rule" "default" {
  route_table_id = "rt-as4npcsp2hve"
  source_address = "192.168.0.0/24"
  destination_address = "192.168.1.0/24"
  next_hop_id = "i-BtXnDM6y"
  next_hop_type = "custom"
  description = "baiducloud route rule created by terraform"
}

```

Use this resource to get information about a SCS.

~> **NOTE:** The terminate operation of scs does NOT take effect immediately,maybe takes for several minites.

Example Usage

```hcl

resource "baiducloud_scs" "default" {
	billing = {
		payment_timing = "Postpaid"
	}
	instance_name = "terraform-redis"
	purchase_count = 1
	port = 6379
	engine_version = "3.2"
	node_type = "cache.n1.micro"
	architecture_type = "master_slave"
	replication_num = 1
	shard_num = 1
}

```

Import

SCS can be imported, e.g.

```hcl $ terraform import baiducloud_scs.default id ```

Provide a resource to create a security group.

Example Usage

```hcl

resource "baiducloud_security_group" "default" {
  name        = "testSecurityGroup"
  description = "default"
  tags = {
    "testKey" = "testValue"
  }
}

```

Import

Bcc SecurityGroup can be imported, e.g.

```hcl $ terraform import baiducloud_security_group.default security_group_id ```

Provide a resource to create a security group rule.

Example Usage

```hcl

resource "baiducloud_security_group" "default" {
  name = "my-sg"
  description = "default"
}
resource "baiducloud_security_group_rule" "default" {
  security_group_id = "${baiducloud_security_group.default.id}"
  remark            = "remark"
  protocol          = "udp"
  port_range        = "1-65523"
  direction         = "ingress"
}

```

Provide a resource to create a Snapshot.

Example Usage

```hcl

resource "baiducloud_snapshot" "my-snapshot" {
  name        = "${var.name}"
  description = "${var.description}"
  volume_id   = "v-Trb3rQXa"
}

```

Import

Snapshot can be imported, e.g.

```hcl $ terraform import baiducloud_snapshot.default id ```

Provide a resource to create a VPC subnet.

Example Usage

```hcl

resource "baiducloud_subnet" "default" {
  name = "my-subnet"
  zone_name = "cn-bj-a"
  cidr = "192.168.3.0/24"
  vpc_id = "${baiducloud_vpc.default.id}"
}
resource "baiducloud_vpc" "default" {
  name = "my-vpc"
  cidr = "192.168.0.0/16"
}

```

Import

VPC subnet instance can be imported, e.g.

```hcl $ terraform import baiducloud_subnet.default subnet_id ```

Provide a resource to create a VPC.

Example Usage

```hcl

resource "baiducloud_vpc" "default" {
    name = "my-vpc"
    description = "baiducloud vpc created by terraform"
	cidr = "192.168.0.0/24"
}

```

Import

VPC instance can be imported, e.g.

```hcl $ terraform import baiducloud_vpc.default vpc_id ```

Index

Constants

View Source
const (
	PAYMENT_TIMING_POSTPAID = "Postpaid"
	PAYMENT_TIMING_PREPAID  = "Prepaid"
)
View Source
const (
	// common error
	ResourceNotFound          = "ResourceNotfound"
	ResourceNotFound2         = "ResourceNotFound"
	ResourceNotFoundException = "ResourceNotFoundException"

	// bcc error
	OperationDenied      = "OperationDenied"
	ReleaseWhileCreating = "Instance.ReleaseWhileCreating"

	// not found error
	InstanceNotFound           = "InstanceNotFound"
	EipNotFound                = "EipNotFound"
	CceNotFound                = "Cce.warning.ClusterNotExist"
	Ccev2ClusterNotFound       = "cce.warning.ClusterNotFound"
	Ccev2InstanceGroupNotFound = "cce.warning.InstanceGroupNotFound"
	InstanceNotExist           = "InstanceNotExist"

	// scs error
	InvalidInstanceStatus = "InvalidInstanceStatus"
	OperationException    = "OperationException"
)
View Source
const (
	TCP   = "TCP"
	UDP   = "UDP"
	HTTP  = "HTTP"
	HTTPS = "HTTPS"
	SSL   = "SSL"
)
View Source
const (
	STORAGE_CLASS_ARCHIVE = "ARCHIVE"

	ACTION_TRANSITION           = "Transition"
	ACTION_DELETEOBJECT         = "DeleteObject"
	ACTION_ABORTMULTIPARTUPLOAD = "AbortMultipartUpload"
)
View Source
const (
	DTSStatusUnConfig        = "unConfig"
	DTSStatusReady           = "ready"
	DTSStatusChecking        = "checking"
	DTSStatusCheckPass       = "checkPass"
	DTSStatusCheckFailed     = "checkFailed"
	DTSStatusRunning         = "running"
	DTSStatusStopping        = "stopping"
	DTSStatusStopped         = "stopped"
	DTSStatusStopCheckFailed = "stopCheckFailed"
	DTSStatusRunFailed       = "runFailed"
	DTSStatusFinished        = "finished"
	DTSStatusDeleted         = "deleted"
)
View Source
const (
	InstanceTypeBCC = "BCC"
	InstanceTypeBLB = "BLB"
	InstanceTypeVPN = "VPN"
	InstanceTypeNAT = "NAT"
)
View Source
const (
	EIPStatusCreating    = "creating"
	EIPStatusAvailable   = "available"
	EIPStatusBinded      = "binded"
	EIPStatusBinding     = "binding"
	EIPStatusUnBinding   = "unbinding"
	EIPStatusUpdating    = "updating"
	EIPStatusPaused      = "paused"
	EIPStatusUnavailable = "unavailable"
)
View Source
const (
	// start the instance
	INSTANCE_ACTION_START = "start"

	// stop the instance
	INSTANCE_ACTION_STOP = "stop"
)
View Source
const (
	RDSStatusCreating               = "Creating"
	RDSStatusRunning                = "Available"
	RDSStatusRebooting              = "Rebooting"
	RDSStatusModifying              = "Modifying"
	RDSStatusMasterModifying        = "MasterModifying"
	RDSStatusReadReplicateModifying = "ReadReplicateModifying"
	RDSStatusDeleted                = "Deleted"
	RDSStatusNotExist               = "NotExist"
)
View Source
const (
	SCSStatusStatusCreating       = "Creating"
	SCSStatusStatusRunning        = "Running"
	SCSStatusStatusRebooting      = "Rebooting"
	SCSStatusStatusPausing        = "Pausing"
	SCSStatusStatusPaused         = "Paused"
	SCSStatusStatusDeleted        = "Deleted"
	SCSStatusStatusDeleting       = "Deleting"
	SCSStatusStatusFailed         = "Failed"
	SCSStatusStatusModifying      = "Modifying"
	SCSStatusStatusModifyfailed   = "Modifyfailed"
	SCSStatusStatusBackuping      = "Backuping"
	SCSStatusStatusAztransforming = "Aztransforming"
	SCSStatusStatusExpire         = "Expire"
	SCSStatusStatusFlushing       = "Flushing"
	SCSStatusStatusFlushFailed    = "Flush failed"
)
View Source
const (
	// subnet in used, can not be deleted
	SUBNET_INUSE_ERROR = "SUBNET_INUSE"

	// security group in used, can not be deleted
	SECURITYGROUP_INUSE_ERROR = "SECURITYGROUP_INUSE"
)
View Source
const (
	PROVIDER_ACCESS_KEY = "BAIDUCLOUD_ACCESS_KEY"
	PROVIDER_SECRET_KEY = "BAIDUCLOUD_SECRET_KEY"
	PROVIDER_REGION     = "BAIDUCLOUD_REGION"
)
View Source
const (
	BOS_BUCKET_ACL_PRIVATE           = "private"
	BOS_BUCKET_ACL_PUBLIC_READ       = "public-read"
	BOS_BUCKET_ACL_PUBLIC_READ_WRITE = "public-read-write"

	BOS_BUCKET_OBJECT_CACHE_CONTROL_PRIVATE         = "private"
	BOS_BUCKET_OBJECT_CACHE_CONTROL_NO_CACHE        = "no-cache"
	BOS_BUCKET_OBJECT_CACHE_CONTROL_MAX_AGE         = "max-age"
	BOS_BUCKET_OBJECT_CACHE_CONTROL_MUST_REVALIDATE = "must-revalidate"

	BOS_BUCKET_OBJECT_CONTENT_DISPOSITION_INLINE     = "inline"
	BOS_BUCKET_OBJECT_CONTENT_DISPOSITION_ATTACHMENT = "attachment"
)
View Source
const (
	// sdk error
	BCESDKGoERROR = ErrorSource("[SDK bce-sdk-go ERROR]")
)
View Source
const CDSNotAttachedErrorCode = "Volume.DiskNotAttachedInstance"
View Source
const COLON_SEPARATED = ","
View Source
const DefaultDebugMsg = "\n*************** %s Response *************** \n%+v\n%s******************************\n\n"
View Source
const DefaultErrorMsg = "Resource %s %s Failed!!! %s"

A default message of ComplexError's Err. It is format to Resource <resource-id> <operation> Failed!!! <error source>

View Source
const DefaultTimeout = 180 * time.Second

timeout for common product, bcc e.g.

View Source
const GetFailTargetStatus = "Get Fail target status: %s."

Variables

View Source
var (
	// bcc error
	BccNotFound = []string{"InvalidInstanceId.NotFound", "Forbidden.InstanceNotFound"}

	// nat gateway error
	NatGatewayNotFound = []string{"NoSuchNat"}

	// peer conn error
	PeerConnNotFound = []string{"EOF"}

	// common error
	ObjectNotFound = []string{"NoSuchObject"}

	// replication configuration error
	ReplicationConfigurationNotFound = []string{"NoReplicationConfiguration"}

	// cce error
	CceClusterNotFound = []string{CceNotFound}

	//ccev2 error
	Ccev2NotFound = []string{Ccev2ClusterNotFound, Ccev2InstanceGroupNotFound}
)
View Source
var APPBLBAvailableStatus = []string{
	string(appblb.BLBStatusAvailable),
}
View Source
var ClusterTypePermitted = []string{
	string(ccev2types.ClusterTypeNormal),
}
View Source
var QueryOrderPermitted = []string{
	string(ccev2.OrderASC),
	string(ccev2.OrderDESC),
}
View Source
var RuntimeTypePermitted = []string{
	string(ccev2types.RuntimeTypeDocker),
}
View Source
var SourceTypeMap = map[string]api.SourceType{
	"bos":     api.SourceType("bos"),
	"http":    api.SourceTypeHTTP,
	"crontab": api.SourceTypeCrontab,
	"dueros":  api.SourceTypeDuerOS,
	"duedge":  api.SourceTypeDuEdge,
	"cdn":     api.SourceTypeCDN,
}
View Source
var TransportProtocol = []string{TCP, UDP, SSL}

Functions

func Error

func Error(msg string, args ...interface{}) error

func FilterDataSourceResult added in v1.1.0

func FilterDataSourceResult(d *schema.ResourceData, result *[]map[string]interface{})

func IsExceptedErrors

func IsExceptedErrors(err error, expectCodes []string) bool

func NotFoundError

func NotFoundError(err error) bool

func Provider

func Provider() terraform.ResourceProvider

func WrapComplexError

func WrapComplexError(cause, err error, filepath string, fileline int) error

func WrapError

func WrapError(cause error) error

Return a ComplexError which including error occurred file and path

func WrapErrorf

func WrapErrorf(cause error, msg string, args ...interface{}) error

Return a ComplexError which including extra error message, error occurred file and path

Types

type APPBLBService

type APPBLBService struct {
	// contains filtered or unexported fields
}

func (*APPBLBService) APPBLBStateRefreshFunc

func (s *APPBLBService) APPBLBStateRefreshFunc(id string, failState []string) resource.StateRefreshFunc

func (*APPBLBService) AppServerGroupBlbRsDetail

func (s *APPBLBService) AppServerGroupBlbRsDetail(blbId, sgId string) ([]appblb.AppBackendServer, error)

func (*APPBLBService) AppServerGroupDetail

func (s *APPBLBService) AppServerGroupDetail(blbId, sgId string) (*appblb.AppServerGroup, error)

func (*APPBLBService) AppServerGroupStateRefreshFunc

func (s *APPBLBService) AppServerGroupStateRefreshFunc(blbId, sgId string, failState []string) resource.StateRefreshFunc

func (*APPBLBService) CreateAppServerGroupPort

func (s *APPBLBService) CreateAppServerGroupPort(blbId string, args *appblb.CreateAppServerGroupPortArgs) error

func (*APPBLBService) CreateAppServerGroupRs

func (s *APPBLBService) CreateAppServerGroupRs(blbId string, args *appblb.CreateBlbRsArgs) error

func (*APPBLBService) DeleteAppServerGroupPort

func (s *APPBLBService) DeleteAppServerGroupPort(blbId string, args *appblb.DeleteAppServerGroupPortArgs) error

func (*APPBLBService) DeleteAppServerGroupRs

func (s *APPBLBService) DeleteAppServerGroupRs(blbId string, args *appblb.DeleteBlbRsArgs) error

func (*APPBLBService) DescribeListener

func (s *APPBLBService) DescribeListener(blbId, protocol string, port int) (interface{}, error)

func (*APPBLBService) DescribePolicys

func (s *APPBLBService) DescribePolicys(blbId, protocol string, port int) ([]appblb.AppPolicy, error)

func (*APPBLBService) FlattenAppBLBDetailsToMap

func (s *APPBLBService) FlattenAppBLBDetailsToMap(models []appblb.AppBLBModel, details map[string]appblb.DescribeLoadBalancerDetailResult) []map[string]interface{}

func (*APPBLBService) FlattenAppBackendServersToMap

func (s *APPBLBService) FlattenAppBackendServersToMap(servers []appblb.AppBackendServer) []map[string]interface{}

func (*APPBLBService) FlattenAppPolicysToMap

func (s *APPBLBService) FlattenAppPolicysToMap(policys []appblb.AppPolicy) []map[string]interface{}

func (*APPBLBService) FlattenAppRsPortsToMap

func (s *APPBLBService) FlattenAppRsPortsToMap(ports []appblb.AppRsPortModel) []map[string]interface{}

func (*APPBLBService) FlattenAppServerGroupPortsToMap

func (s *APPBLBService) FlattenAppServerGroupPortsToMap(group []appblb.AppServerGroupPort) []map[string]interface{}

func (*APPBLBService) FlattenListenerModelToMap

func (s *APPBLBService) FlattenListenerModelToMap(listeners []appblb.ListenerModel) []map[string]interface{}

func (*APPBLBService) GetAppBLBDetail

func (*APPBLBService) ListAllHTTPListeners

func (s *APPBLBService) ListAllHTTPListeners(blbId string, port int) ([]map[string]interface{}, error)

func (*APPBLBService) ListAllHTTPSListeners

func (s *APPBLBService) ListAllHTTPSListeners(blbId string, port int) ([]map[string]interface{}, error)

func (*APPBLBService) ListAllListeners

func (s *APPBLBService) ListAllListeners(blbId, protocol string, port int) ([]map[string]interface{}, error)

func (*APPBLBService) ListAllSSLListeners

func (s *APPBLBService) ListAllSSLListeners(blbId string, port int) ([]map[string]interface{}, error)

func (*APPBLBService) ListAllServerGroups

func (s *APPBLBService) ListAllServerGroups(blbId string, args *appblb.DescribeAppServerGroupArgs) ([]map[string]interface{}, error)

func (*APPBLBService) ListAllTCPListeners

func (s *APPBLBService) ListAllTCPListeners(blbId string, port int) ([]map[string]interface{}, error)

func (*APPBLBService) ListAllUDPListeners

func (s *APPBLBService) ListAllUDPListeners(blbId string, port int) ([]map[string]interface{}, error)

func (*APPBLBService) UpdateAppServerGroupPort

func (s *APPBLBService) UpdateAppServerGroupPort(blbId string, args *appblb.UpdateAppServerGroupPortArgs) error

func (*APPBLBService) UpdateAppServerGroupRs

func (s *APPBLBService) UpdateAppServerGroupRs(blbId string, args *appblb.UpdateBlbRsArgs) error

func (*APPBLBService) WaitForServerGroupUpdateFinish

func (s *APPBLBService) WaitForServerGroupUpdateFinish(d *schema.ResourceData) error

type BccService

type BccService struct {
	// contains filtered or unexported fields
}

func (*BccService) AttachCDSVolume

func (s *BccService) AttachCDSVolume(volumeId, instanceId string) error

func (*BccService) CDSVolumeStateRefreshFunc

func (s *BccService) CDSVolumeStateRefreshFunc(id string, failState []string) resource.StateRefreshFunc

func (*BccService) DetachCDSVolume

func (s *BccService) DetachCDSVolume(volumeId, instanceId string) error

func (*BccService) FlattenAutoSnapshotPolicyModelToMap

func (s *BccService) FlattenAutoSnapshotPolicyModelToMap(aspList []api.AutoSnapshotPolicyModel) []map[string]interface{}

func (*BccService) FlattenCDSVolumeModelToMap

func (s *BccService) FlattenCDSVolumeModelToMap(cdsList []api.VolumeModel) []map[string]interface{}

func (*BccService) FlattenImageModelToMap

func (s *BccService) FlattenImageModelToMap(images []api.ImageModel) []map[string]interface{}

func (*BccService) FlattenInstanceModelToMap

func (s *BccService) FlattenInstanceModelToMap(instances []api.InstanceModel) ([]map[string]interface{}, error)

func (*BccService) FlattenSecurityGroupModelToMap

func (s *BccService) FlattenSecurityGroupModelToMap(sgList []api.SecurityGroupModel) []map[string]interface{}

func (*BccService) FlattenSecurityGroupRuleModelsToMap

func (s *BccService) FlattenSecurityGroupRuleModelsToMap(list []api.SecurityGroupRuleModel) []map[string]interface{}

func (*BccService) FlattenSnapshotModelToMap

func (s *BccService) FlattenSnapshotModelToMap(snapshots []api.SnapshotModel) []map[string]interface{}

func (*BccService) FlattenVolumeAttachmentModelToMap

func (s *BccService) FlattenVolumeAttachmentModelToMap(attachments []api.VolumeAttachmentModel) []map[string]interface{}

func (*BccService) GetCDSVolumeDetail

func (s *BccService) GetCDSVolumeDetail(volumeId string) (*api.VolumeModel, error)

func (*BccService) GetInstanceDetail

func (s *BccService) GetInstanceDetail(instanceID string) (*api.InstanceModel, error)

func (*BccService) GetSecurityGroupRule

func (s *BccService) GetSecurityGroupRule(ruleId string) (*api.SecurityGroupRuleModel, error)

func (*BccService) GetSystemVolume

func (s *BccService) GetSystemVolume(instanceId string) (*api.VolumeModel, error)

func (*BccService) InstanceStateRefresh

func (s *BccService) InstanceStateRefresh(instanceId string) resource.StateRefreshFunc

func (*BccService) ListAllAutoSnapshotPolicies

func (s *BccService) ListAllAutoSnapshotPolicies(args *api.ListASPArgs) ([]api.AutoSnapshotPolicyModel, error)

func (*BccService) ListAllCDSVolumeDetail

func (s *BccService) ListAllCDSVolumeDetail(args *api.ListCDSVolumeArgs) ([]api.VolumeModel, error)

func (*BccService) ListAllEphemeralVolumes

func (s *BccService) ListAllEphemeralVolumes(instanceId string) ([]api.VolumeModel, error)

func (*BccService) ListAllImages

func (s *BccService) ListAllImages(args *api.ListImageArgs) ([]api.ImageModel, error)

func (*BccService) ListAllInstance

func (s *BccService) ListAllInstance(args *api.ListInstanceArgs) ([]api.InstanceModel, error)

func (*BccService) ListAllSecurityGroups

func (s *BccService) ListAllSecurityGroups(args *api.ListSecurityGroupArgs) ([]api.SecurityGroupModel, error)

func (*BccService) ListAllSnapshots

func (s *BccService) ListAllSnapshots(volumeId string) ([]api.SnapshotModel, error)

func (*BccService) ListAllVolumes

func (s *BccService) ListAllVolumes(instanceId string) ([]api.VolumeModel, error)

func (*BccService) ModifyCDSVolume

func (s *BccService) ModifyCDSVolume(volumeId, name, desc string) error

func (*BccService) ModifyChargeTypeCDSVolume

func (s *BccService) ModifyChargeTypeCDSVolume(volumeId string, args *api.ModifyChargeTypeCSDVolumeArgs) error

func (*BccService) ResizeCDSVolume

func (s *BccService) ResizeCDSVolume(volumeId string, newSize int) error

func (*BccService) SnapshotStateRefreshFunc

func (s *BccService) SnapshotStateRefreshFunc(id string, failState []string) resource.StateRefreshFunc

func (*BccService) StartInstance added in v1.2.0

func (s *BccService) StartInstance(instanceID string, timeout time.Duration) error

func (*BccService) StopInstance added in v1.2.0

func (s *BccService) StopInstance(instanceID string, timeout time.Duration) error

type BosService

type BosService struct {
	// contains filtered or unexported fields
}

func (*BosService) ListAllObjects

func (s *BosService) ListAllObjects(bucket, prefix string) ([]api.ObjectSummaryType, error)

type CFCService

type CFCService struct {
	// contains filtered or unexported fields
}

func (*CFCService) CFCDeleteFunctionVersion

func (c *CFCService) CFCDeleteFunctionVersion(functionName, functionVersion string) error

func (*CFCService) CFCDeleteReservedConcurrent

func (c *CFCService) CFCDeleteReservedConcurrent(functionName string) error

func (*CFCService) CFCGetTriggerByFunction

func (c *CFCService) CFCGetTriggerByFunction(functionBrn, relationId string) (*api.RelationInfo, error)

func (*CFCService) CFCGetVersionsByFunction

func (c *CFCService) CFCGetVersionsByFunction(functionName, functionVersion string) (*api.Function, error)

func (*CFCService) CFCListAllVersionsByFunction

func (c *CFCService) CFCListAllVersionsByFunction(functionName string) ([]*api.Function, error)

func (*CFCService) CFCSetReservedConcurrent

func (c *CFCService) CFCSetReservedConcurrent(functionName string, newConcurrent int) error

func (*CFCService) CFCUpdateFunctionCode

func (c *CFCService) CFCUpdateFunctionCode(functionName string, d *schema.ResourceData) error

func (*CFCService) CFCUpdateFunctionConfigure

func (c *CFCService) CFCUpdateFunctionConfigure(updateArgs *api.UpdateFunctionConfigurationArgs) error

func (*CFCService) ListAllFunctions

func (c *CFCService) ListAllFunctions() ([]*api.Function, error)

type CceService added in v1.3.0

type CceService struct {
	// contains filtered or unexported fields
}

func (*CceService) ClusterStateRefresh added in v1.3.0

func (s *CceService) ClusterStateRefresh(clusterUuid string, failState []cce.ClusterStatus) resource.StateRefreshFunc

type Ccev2Service added in v1.8.0

type Ccev2Service struct {
	// contains filtered or unexported fields
}

func (*Ccev2Service) ClusterStateRefreshCCEv2 added in v1.8.0

func (s *Ccev2Service) ClusterStateRefreshCCEv2(clusterId string, failState []ccev2types.ClusterPhase) resource.StateRefreshFunc

type ComplexError

type ComplexError struct {
	Cause error
	Err   error
	Path  string
	Line  int
}

ComplexError is a format error which inclouding origin error, extra error message, error occurred file and line Cause: a error is a origin error that comes from SDK, some expections and so on Err: a new error is built from extra message Path: the file path of error occurred Line: the file line of error occurred

func (ComplexError) Error

func (e ComplexError) Error() string

type DataSourceFilter added in v1.1.0

type DataSourceFilter map[string][]FilterConfig

func NewDataSourceFilter added in v1.1.0

func NewDataSourceFilter(d *schema.ResourceData) DataSourceFilter

type DtsService added in v1.7.0

type DtsService struct {
	// contains filtered or unexported fields
}

func (*DtsService) Config added in v1.7.0

func (e *DtsService) Config(taskId string, configArgs *dts.ConfigArgs) (*dts.ConfigDtsResult, error)

func (*DtsService) FlattenDtsModelsToMap added in v1.7.0

func (e *DtsService) FlattenDtsModelsToMap(dtss []dts.DtsTaskMeta) []map[string]interface{}

func (*DtsService) GetPreCheck added in v1.7.0

func (e *DtsService) GetPreCheck(taskId string) ([]dts.CheckResult, error)

func (*DtsService) GetTaskDetail added in v1.7.0

func (e *DtsService) GetTaskDetail(taskID string) (*dts.DtsTaskMeta, error)

func (*DtsService) ListAllDtss added in v1.7.0

func (e *DtsService) ListAllDtss(listArgs *dts.ListDtsArgs) ([]dts.DtsTaskMeta, error)

func (*DtsService) PauseDts added in v1.7.0

func (e *DtsService) PauseDts(taskId string) error

func (*DtsService) PreCheck added in v1.7.0

func (e *DtsService) PreCheck(taskId string) (*dts.PreCheckResult, error)

func (*DtsService) ShutdownDts added in v1.7.0

func (e *DtsService) ShutdownDts(taskId string) error

func (*DtsService) StartDts added in v1.7.0

func (e *DtsService) StartDts(taskId string) error

func (*DtsService) TaskStateRefresh added in v1.7.0

func (e *DtsService) TaskStateRefresh(taskId string, failState []string) resource.StateRefreshFunc

type EipService

type EipService struct {
	// contains filtered or unexported fields
}

func (*EipService) EipBind

func (e *EipService) EipBind(ip, instanceType, instanceId string) error

func (*EipService) EipGetDetail

func (e *EipService) EipGetDetail(ip string) (*eip.EipModel, error)

func (*EipService) EipResizeBandwidth

func (e *EipService) EipResizeBandwidth(ip string, new int) error

func (*EipService) EipStateRefreshFunc

func (e *EipService) EipStateRefreshFunc(ip string, failState []string) resource.StateRefreshFunc

func (*EipService) EipUnBind

func (e *EipService) EipUnBind(ip string) error

func (*EipService) FlattenEipModelsToMap

func (e *EipService) FlattenEipModelsToMap(eips []eip.EipModel) []map[string]interface{}

func (*EipService) ListAllEips

func (e *EipService) ListAllEips(listArgs *eip.ListEipArgs) ([]eip.EipModel, error)

func (*EipService) StartAutoRenew added in v1.2.0

func (e *EipService) StartAutoRenew(ip string, args *eip.StartAutoRenewArgs) error

func (*EipService) StopAutoRenew added in v1.2.0

func (e *EipService) StopAutoRenew(ip string) error

type ErrorSource

type ErrorSource string

type FilterConfig added in v1.1.0

type FilterConfig struct {
	// contains filtered or unexported fields
}

type RdsService added in v1.5.0

type RdsService struct {
	// contains filtered or unexported fields
}

func (*RdsService) FlattenRdsModelsToMap added in v1.5.0

func (e *RdsService) FlattenRdsModelsToMap(rdss []rds.Instance) []map[string]interface{}

func (*RdsService) GetInstanceDetail added in v1.5.0

func (s *RdsService) GetInstanceDetail(instanceID string) (*rds.Instance, error)

func (*RdsService) InstanceStateRefresh added in v1.5.0

func (s *RdsService) InstanceStateRefresh(instanceId string, failState []string) resource.StateRefreshFunc

func (*RdsService) ListAllInstances added in v1.5.0

func (s *RdsService) ListAllInstances(args *rds.ListRdsArgs) ([]rds.Instance, error)

type ScsService added in v1.4.0

type ScsService struct {
	// contains filtered or unexported fields
}

func (*ScsService) FlattenScsModelsToMap added in v1.4.0

func (e *ScsService) FlattenScsModelsToMap(scss []scs.InstanceModel) []map[string]interface{}

func (*ScsService) GetInstanceDetail added in v1.4.0

func (s *ScsService) GetInstanceDetail(instanceID string) (*scs.GetInstanceDetailResult, error)

func (*ScsService) GetNodeTypeList added in v1.4.0

func (s *ScsService) GetNodeTypeList() (*scs.GetNodeTypeListResult, error)

func (*ScsService) InstanceStateRefresh added in v1.4.0

func (s *ScsService) InstanceStateRefresh(instanceId string, failState []string) resource.StateRefreshFunc

func (*ScsService) ListAllInstances added in v1.4.0

func (s *ScsService) ListAllInstances(args *scs.ListInstancesArgs) ([]scs.InstanceModel, error)

type VpcService

type VpcService struct {
	// contains filtered or unexported fields
}

func (*VpcService) ClosePeerConnDNSSync

func (s *VpcService) ClosePeerConnDNSSync(d *schema.ResourceData, peerConnId string, role vpc.PeerConnRoleType) error

func (*VpcService) DescribeAclRules

func (s *VpcService) DescribeAclRules(subnetId string) ([]vpc.AclRule, error)

func (*VpcService) GetNatGatewayDetail

func (s *VpcService) GetNatGatewayDetail(natID string) (*vpc.NAT, error)

func (*VpcService) GetPeerConnDetail

func (s *VpcService) GetPeerConnDetail(peerConnID string, role vpc.PeerConnRoleType) (*vpc.PeerConn, error)

func (*VpcService) GetRouteTableDetail

func (s *VpcService) GetRouteTableDetail(routeTableID, vpcID string) (*vpc.GetRouteTableResult, error)

func (*VpcService) GetSubnetDetail

func (s *VpcService) GetSubnetDetail(subnetID string) (*vpc.GetSubnetDetailResult, error)

func (*VpcService) GetVPCDetail

func (s *VpcService) GetVPCDetail(vpcID string) (*vpc.GetVPCDetailResult, error)

func (*VpcService) ListAllAclEntrysWithVPCID

func (s *VpcService) ListAllAclEntrysWithVPCID(vpcID string) ([]vpc.AclEntry, error)

func (*VpcService) ListAllAclRulesWithSubnetID

func (s *VpcService) ListAllAclRulesWithSubnetID(subnetID string) ([]vpc.AclRule, error)

func (*VpcService) ListAllNatGateways

func (s *VpcService) ListAllNatGateways(args *vpc.ListNatGatewayArgs) ([]vpc.NAT, error)

func (*VpcService) ListAllPeerConns

func (s *VpcService) ListAllPeerConns(vpcID string) ([]vpc.PeerConn, error)

func (*VpcService) ListAllSubnets

func (s *VpcService) ListAllSubnets(args *vpc.ListSubnetArgs) ([]vpc.Subnet, error)

func (*VpcService) ListAllVpcs

func (s *VpcService) ListAllVpcs() ([]vpc.VPC, error)

func (*VpcService) NatGatewayStateRefresh

func (s *VpcService) NatGatewayStateRefresh(natId string) resource.StateRefreshFunc

func (*VpcService) OpenPeerConnDNSSync

func (s *VpcService) OpenPeerConnDNSSync(d *schema.ResourceData, peerConnId string, role vpc.PeerConnRoleType) error

func (*VpcService) PeerConnDNSStatusRefresh

func (s *VpcService) PeerConnDNSStatusRefresh(peerConnId string, role vpc.PeerConnRoleType) resource.StateRefreshFunc

func (*VpcService) PeerConnStateRefresh

func (s *VpcService) PeerConnStateRefresh(peerConnId string, role vpc.PeerConnRoleType) resource.StateRefreshFunc

type WrapErrorOld

type WrapErrorOld struct {
	// contains filtered or unexported fields
}

An Error to wrap the different erros

func (*WrapErrorOld) Error

func (e *WrapErrorOld) Error() string

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL