Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve examples for cr #7813

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions website/docs/r/cr_chain.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,38 @@ variable "name" {
default = "tf-example"
}

resource "random_integer" "default" {
min = 100000
max = 999999
}

resource "alicloud_cr_ee_instance" "default" {
payment_type = "Subscription"
period = 1
renew_period = 0
renewal_status = "ManualRenewal"
instance_type = "Advanced"
instance_name = var.name
instance_name = "${var.name}-${random_integer.default.result}"
}

resource "alicloud_cr_ee_namespace" "default" {
instance_id = alicloud_cr_ee_instance.default.id
name = var.name
name = "${var.name}-${random_integer.default.result}"
auto_create = false
default_visibility = "PUBLIC"
}

resource "alicloud_cr_ee_repo" "default" {
instance_id = alicloud_cr_ee_instance.default.id
namespace = alicloud_cr_ee_namespace.default.name
name = var.name
name = "${var.name}-${random_integer.default.result}"
summary = "this is summary of my new repo"
repo_type = "PUBLIC"
detail = "this is a public repo"
}

resource "alicloud_cr_chain" "default" {
chain_name = var.name
chain_name = "${var.name}-${random_integer.default.result}"
description = var.name
instance_id = alicloud_cr_ee_namespace.default.instance_id
repo_name = alicloud_cr_ee_repo.default.name
Expand Down
12 changes: 9 additions & 3 deletions website/docs/r/cr_chart_repository.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,30 @@ Basic Usage
variable "name" {
default = "tf-example"
}

resource "random_integer" "default" {
min = 100000
max = 999999
}

resource "alicloud_cr_ee_instance" "example" {
payment_type = "Subscription"
period = 1
renew_period = 0
renewal_status = "ManualRenewal"
instance_type = "Advanced"
instance_name = var.name
instance_name = "${var.name}-${random_integer.default.result}"
}

resource "alicloud_cr_chart_namespace" "example" {
instance_id = alicloud_cr_ee_instance.example.id
namespace_name = var.name
namespace_name = "${var.name}-${random_integer.default.result}"
}

resource "alicloud_cr_chart_repository" "example" {
repo_namespace_name = alicloud_cr_chart_namespace.example.namespace_name
instance_id = alicloud_cr_chart_namespace.example.instance_id
repo_name = var.name
repo_name = "${var.name}-${random_integer.default.result}"
}
```

Expand Down
12 changes: 6 additions & 6 deletions website/docs/r/cr_repo.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ resource "alicloud_cr_repo" "example" {
namespace = alicloud_cr_namespace.example.name
name = var.name
summary = "this is summary of my new repo"
repo_type = "PUBLIC"
detail = "this is a public repo"
repo_type = "PRIVATE"
detail = "this is a private repo"
}
```

Expand All @@ -53,16 +53,16 @@ The following arguments are supported:
* `summary` - (Required) The repository general information. It can contain 1 to 80 characters.
* `repo_type` - (Required) `PUBLIC` or `PRIVATE`, repo's visibility.
* `detail` - (Optional) The repository specific information. MarkDown format is supported, and the length limit is 2000.
* `domain_list` - (Optional) The repository domain list.
* `public` - Domain of public endpoint.
* `internal` - Domain of internal endpoint, only in some regions.
* `vpc` - Domain of vpc endpoint.

## Attributes Reference

The following attributes are exported:

* `id` - The id of Container Registry repository. The value is in format `namespace/repository`.
* `domain_list` - (Optional) The repository domain list.
* `public` - Domain of public endpoint.
* `internal` - Domain of internal endpoint, only in some regions.
* `vpc` - Domain of vpc endpoint.

## Import

Expand Down
12 changes: 9 additions & 3 deletions website/docs/r/cr_vpc_endpoint_linked_vpc.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,22 @@ Basic Usage
variable "name" {
default = "tf-example"
}

resource "random_integer" "default" {
min = 100000
max = 999999
}

data "alicloud_zones" "default" {
available_resource_creation = "VSwitch"
}
resource "alicloud_vpc" "default" {
vpc_name = var.name
vpc_name = "${var.name}-${random_integer.default.result}"
cidr_block = "10.4.0.0/16"
}

resource "alicloud_vswitch" "default" {
vswitch_name = var.name
vswitch_name = "${var.name}-${random_integer.default.result}"
cidr_block = "10.4.0.0/24"
vpc_id = alicloud_vpc.default.id
zone_id = data.alicloud_zones.default.zones.0.id
Expand All @@ -50,7 +56,7 @@ resource "alicloud_cr_ee_instance" "default" {
renew_period = 0
renewal_status = "ManualRenewal"
instance_type = "Advanced"
instance_name = var.name
instance_name = "${var.name}-${random_integer.default.result}"
}

resource "alicloud_cr_vpc_endpoint_linked_vpc" "default" {
Expand Down
Loading