Skip to content

Commit

Permalink
website/docs: Run terraform fmt on code examples (#12075)
Browse files Browse the repository at this point in the history
* docs/vsphere: Fix code block

* docs: Convert `...` to `# ...` to allow `terraform fmt`ing

* docs: Trim trailing whitespace

* docs: First-pass run of `terraform fmt` on code examples
  • Loading branch information
gechr authored and stack72 committed Feb 18, 2017
1 parent 9a6cb36 commit 11abc92
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
31 changes: 16 additions & 15 deletions index.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ The following is a minimal example:
```
# Configure the MySQL provider
provider "mysql" {
endpoint = "my-database.example.com:3306"
username = "app-user"
password = "app-password"
endpoint = "my-database.example.com:3306"
username = "app-user"
password = "app-password"
}
# Create a Database
resource "mysql_database" "app" {
name = "my_awesome_app"
name = "my_awesome_app"
}
```

Expand All @@ -39,27 +39,28 @@ servers in Amazon's RDS service.
```
# Create a database server
resource "aws_db_instance" "default" {
engine = "mysql"
engine_version = "5.6.17"
instance_class = "db.t1.micro"
name = "initial_db"
username = "rootuser"
password = "rootpasswd"
# etc, etc; see aws_db_instance docs for more
engine = "mysql"
engine_version = "5.6.17"
instance_class = "db.t1.micro"
name = "initial_db"
username = "rootuser"
password = "rootpasswd"
# etc, etc; see aws_db_instance docs for more
}
# Configure the MySQL provider based on the outcome of
# creating the aws_db_instance.
provider "mysql" {
endpoint = "${aws_db_instance.default.endpoint}"
username = "${aws_db_instance.default.username}"
password = "${aws_db_instance.default.password}"
endpoint = "${aws_db_instance.default.endpoint}"
username = "${aws_db_instance.default.username}"
password = "${aws_db_instance.default.password}"
}
# Create a second database, in addition to the "initial_db" created
# by the aws_db_instance resource above.
resource "mysql_database" "app" {
name = "another_db"
name = "another_db"
}
```

Expand Down
2 changes: 1 addition & 1 deletion r/database.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on your database resources as an extra safety measure.

```
resource "mysql_database" "app" {
name = "my_awesome_app"
name = "my_awesome_app"
}
```

Expand Down
14 changes: 7 additions & 7 deletions r/grant.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ a user on a MySQL server.

```
resource "mysql_user" "jdoe" {
user = "jdoe"
host = "example.com"
password = "password"
user = "jdoe"
host = "example.com"
password = "password"
}
resource "mysql_grant" "jdoe" {
user = "${mysql_user.jdoe.user}"
host = "${mysql_user.jdoe.host}"
database = "app"
privileges = ["SELECT", "UPDATE"]
user = "${mysql_user.jdoe.user}"
host = "${mysql_user.jdoe.host}"
database = "app"
privileges = ["SELECT", "UPDATE"]
}
```

Expand Down
6 changes: 3 additions & 3 deletions r/user.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ server.

```
resource "mysql_user" "jdoe" {
user = "jdoe"
host = "example.com"
password = "password"
user = "jdoe"
host = "example.com"
password = "password"
}
```

Expand Down

0 comments on commit 11abc92

Please sign in to comment.