Skip to content

Commit

Permalink
Merge pull request #1822 from acwwat/d-awscc_lightsail-add_examples
Browse files Browse the repository at this point in the history
docs: Add examples for awscc_lightsail_*
  • Loading branch information
justinretzolk authored Jul 19, 2024
2 parents 65a6711 + 9bd6710 commit 78af834
Show file tree
Hide file tree
Showing 43 changed files with 1,476 additions and 231 deletions.
123 changes: 102 additions & 21 deletions docs/resources/lightsail_alarm.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,98 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "awscc_lightsail_alarm Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Resource Type definition for AWS::Lightsail::Alarm
---

# awscc_lightsail_alarm (Resource)

Resource Type definition for AWS::Lightsail::Alarm



---
page_title: "awscc_lightsail_alarm Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Resource Type definition for AWS::Lightsail::Alarm
---

# awscc_lightsail_alarm (Resource)

Resource Type definition for AWS::Lightsail::Alarm

## Example Usage

### Alarm for Instance CPU Utilization

```terraform
resource "awscc_lightsail_instance" "example" {
blueprint_id = "amazon_linux_2023"
bundle_id = "nano_3_0"
instance_name = "example-instance"
}
resource "awscc_lightsail_alarm" "example" {
alarm_name = "example-alarm"
comparison_operator = "GreaterThanThreshold"
evaluation_periods = 1
metric_name = "CPUUtilization"
monitored_resource_name = awscc_lightsail_instance.example.instance_name
threshold = 90
}
```

### Alarm for Load Balancer Unhealthy Host Count

```terraform
resource "awscc_lightsail_instance" "example" {
blueprint_id = "nginx"
bundle_id = "nano_3_0"
instance_name = "example-instance"
}
resource "awscc_lightsail_load_balancer" "example" {
instance_port = 80
load_balancer_name = "example-lb"
attached_instances = [awscc_lightsail_instance.example.instance_name]
}
# Since there is no resource for contact method, we need to create it using null_resource and the AWS CLI instead
resource "null_resource" "example_contact_method" {
provisioner "local-exec" {
command = "aws lightsail create-contact-method --protocol Email --contact-endpoint [email protected]"
}
provisioner "local-exec" {
when = destroy
command = "aws lightsail delete-contact-method --protocol Email"
}
}
resource "awscc_lightsail_alarm" "example" {
alarm_name = "example-alarm"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = 1
metric_name = "UnhealthyHostCount"
monitored_resource_name = awscc_lightsail_load_balancer.example.load_balancer_name
threshold = 1
contact_protocols = ["Email"]
notification_enabled = true
notification_triggers = ["ALARM"]
treat_missing_data = "ignore"
depends_on = [null_resource.example_contact_method]
}
```

### Alarm for Relational Database Free Storage Space

```terraform
resource "awscc_lightsail_database" "example" {
master_database_name = "example"
master_username = "admin"
relational_database_blueprint_id = "mysql_8_0"
relational_database_bundle_id = "micro_2_0"
relational_database_name = "example-db"
}
resource "awscc_lightsail_alarm" "example" {
alarm_name = "example-alarm"
comparison_operator = "LessThanThreshold"
evaluation_periods = 1
metric_name = "FreeStorageSpace"
monitored_resource_name = awscc_lightsail_database.example.relational_database_name
threshold = 10737418240
notification_triggers = ["ALARM"]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand All @@ -36,12 +117,12 @@ Resource Type definition for AWS::Lightsail::Alarm

- `alarm_arn` (String)
- `id` (String) Uniquely identifies the resource.
- `state` (String) The current state of the alarm.

## Import

Import is supported using the following syntax:

- `state` (String) The current state of the alarm.

## Import

Import is supported using the following syntax:

```shell
$ terraform import awscc_lightsail_alarm.example <resource ID>
```
```
76 changes: 55 additions & 21 deletions docs/resources/lightsail_bucket.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,51 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "awscc_lightsail_bucket Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Resource Type definition for AWS::Lightsail::Bucket
---

# awscc_lightsail_bucket (Resource)

Resource Type definition for AWS::Lightsail::Bucket



---
page_title: "awscc_lightsail_bucket Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Resource Type definition for AWS::Lightsail::Bucket
---

# awscc_lightsail_bucket (Resource)

Resource Type definition for AWS::Lightsail::Bucket

## Example Usage

### Basic Usage

```terraform
resource "awscc_lightsail_bucket" "example" {
bucket_name = "example-bucket"
bundle_id = "small_1_0"
tags = [{
key = "Modified By"
value = "AWSCC"
}]
}
```

### With Security-Related Settings

```terraform
resource "awscc_lightsail_instance" "example" {
blueprint_id = "amazon_linux_2023"
bundle_id = "nano_3_0"
instance_name = "example-instance"
}
resource "awscc_lightsail_bucket" "example" {
bucket_name = "example-bucket"
bundle_id = "small_1_0"
access_rules = {
allow_public_overrides = false
get_object = "private"
}
object_versioning = true
read_only_access_accounts = ["222222222222"]
resources_receiving_access = [awscc_lightsail_instance.example.instance_name]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand Down Expand Up @@ -53,12 +87,12 @@ Required:

Optional:

- `value` (String) The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

## Import

Import is supported using the following syntax:

- `value` (String) The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

## Import

Import is supported using the following syntax:

```shell
$ terraform import awscc_lightsail_bucket.example <resource ID>
```
```
53 changes: 32 additions & 21 deletions docs/resources/lightsail_certificate.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "awscc_lightsail_certificate Resource - terraform-provider-awscc"
subcategory: ""
description: |-
An example resource schema demonstrating some basic constructs and validation rules.
---

# awscc_lightsail_certificate (Resource)

An example resource schema demonstrating some basic constructs and validation rules.



---
page_title: "awscc_lightsail_certificate Resource - terraform-provider-awscc"
subcategory: ""
description: |-
An example resource schema demonstrating some basic constructs and validation rules.
---

# awscc_lightsail_certificate (Resource)

An example resource schema demonstrating some basic constructs and validation rules.

## Example Usage

```terraform
resource "awscc_lightsail_certificate" "example" {
certificate_name = "example-cert"
domain_name = "example.com"
subject_alternative_names = ["www.example.com"]
tags = [{
key = "Modified By"
value = "AWSCC"
}]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand Down Expand Up @@ -40,12 +51,12 @@ Required:

Optional:

- `value` (String) The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

## Import

Import is supported using the following syntax:

- `value` (String) The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

## Import

Import is supported using the following syntax:

```shell
$ terraform import awscc_lightsail_certificate.example <resource ID>
```
```
67 changes: 46 additions & 21 deletions docs/resources/lightsail_container.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,42 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "awscc_lightsail_container Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Resource Type definition for AWS::Lightsail::Container
---

# awscc_lightsail_container (Resource)

Resource Type definition for AWS::Lightsail::Container



---
page_title: "awscc_lightsail_container Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Resource Type definition for AWS::Lightsail::Container
---

# awscc_lightsail_container (Resource)

Resource Type definition for AWS::Lightsail::Container

## Example Usage

```terraform
resource "awscc_lightsail_container" "example" {
power = "nano"
scale = "1"
service_name = "example-service"
container_service_deployment = {
containers = [{
container_name = "example-container"
image = "public.ecr.aws/nginx/nginx:latest"
ports = [{
port = 80
protocol = "HTTP"
}]
}]
public_endpoint = {
container_name = "example-container"
container_port = 80
}
}
tags = [{
key = "Modified By"
value = "AWSCC"
}]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand Down Expand Up @@ -136,12 +161,12 @@ Required:

Optional:

- `value` (String) The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

## Import

Import is supported using the following syntax:

- `value` (String) The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

## Import

Import is supported using the following syntax:

```shell
$ terraform import awscc_lightsail_container.example <resource ID>
```
```
Loading

0 comments on commit 78af834

Please sign in to comment.