Skip to content

Commit

Permalink
Merge pull request #21 from terraform-aws-modules/added-eip-to-example
Browse files Browse the repository at this point in the history
Added aws_eip to example and pre-commit hooks
  • Loading branch information
antonbabenko authored Mar 1, 2018
2 parents ed1ab2c + 1bde40a commit 7a3aafb
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# EditorConfig is awesome: http://EditorConfig.org
# Uses editorconfig to maintain consistent coding styles

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true

[*.{tf,tfvars}]
indent_size = 2
indent_style = space

[*.md]
max_line_length = 0
trim_trailing_whitespace = false

[Makefile]
tab_width = 2
indent_style = tab

[COMMIT_EDITMSG]
max_line_length = 0
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
sha: v1.4.0
hooks:
- id: terraform_fmt
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: v1.2.0
hooks:
- id: check-merge-conflict
2 changes: 1 addition & 1 deletion examples/basic/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Basic EC2 instance
==================

Configuration in this directory creates single EC2 instance with minimum set of arguments: AMI ID and instance type.
Configuration in this directory creates single EC2 instance with minimum set of arguments: AMI ID and instance type. It will also assign Elastic IP (EIP) to an instance.

Unspecified arguments for security group id and subnet are inherited from the default VPC.

Expand Down
5 changes: 5 additions & 0 deletions examples/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ module "security_group" {
egress_rules = ["all-all"]
}

resource "aws_eip" "openvnp_eip" {
vpc = true
instance = "${module.ec2.id[0]}"
}

module "ec2" {
source = "../../"

Expand Down

0 comments on commit 7a3aafb

Please sign in to comment.