Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sysadm-provisioning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Platform
Infrastructure
sysadm-provisioning
Commits
db27e3d0
Verified
Commit
db27e3d0
authored
5 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
terraform/azure: Extract default setup in init.tf
parent
07128ae2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
azure/terraform/README.md
+9
-3
9 additions, 3 deletions
azure/terraform/README.md
azure/terraform/init.tf
+33
-0
33 additions, 0 deletions
azure/terraform/init.tf
azure/terraform/vault.tf
+0
-24
0 additions, 24 deletions
azure/terraform/vault.tf
with
42 additions
and
27 deletions
azure/terraform/README.md
+
9
−
3
View file @
db27e3d0
...
...
@@ -52,9 +52,6 @@ differential plan:
terraform plan
```
Note: It might be a good idea to change the
`variables.tf`
file to adapt for
example the admin user and its associated public key
# Apply changes
Same as previous command except that it applies the diff to the infra
...
...
@@ -63,3 +60,12 @@ Same as previous command except that it applies the diff to the infra
```
terraform apply
```
Note: adapt the
`init.tf`
file with the admin user's associated public key
first. That will allow you to connect (ssh) to the new nodes you created (if
any).
# Arborescence
-
init.tf: Common resources in our azure infrastructure
-
vault.tf: Vault node definition
This diff is collapsed.
Click to expand it.
azure/terraform/
variables
.tf
→
azure/terraform/
init
.tf
+
33
−
0
View file @
db27e3d0
# Keyword use:
# - provider: Define the provider(s)
# - data: Retrieve data information to be used within the file
# - resource: Define resource and create/update
# Configure the Microsoft Azure Provider
# Empty if using the `az login` tool
provider
"azurerm"
{
version
=
"~> 1.27"
}
# Reuse the network security group as defined currently
data
"azurerm_network_security_group"
"worker-nsg"
{
name
=
"worker-nsg"
resource_group_name
=
"swh-resource"
}
# Same for the subnet
data
"azurerm_subnet"
"default"
{
name
=
"default"
virtual_network_name
=
"swh-vnet"
resource_group_name
=
"swh-resource"
}
variable
"ssh_key_data"
{
type
=
"string"
default
=
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZarzgHrzUYspvrgSI6fszrALo92BDys7QOkJgUfZa9t9m4g7dUANNtwBiqIbqijAQPmB1zKgG6QTZC5rJkRy6KqXCW/+Qeedw/FWIbuI7jOD5WxnglbEQgvPkkB8kf1xIF7icRfWcQmK2je/3sFd9yS4/+jftNMPPXkBCxYm74onMenyllA1akA8FLyujLu6MNA1D8iLLXvz6pBDTT4GZ5/bm3vSE6Go8Xbuyu4SCtYZSHaHC2lXZ6Hhi6dbli4d3OwkUWz+YhFGaEra5Fx45Iig4UCL6kXPkvL/oSc9KGerpT//Xj9qz1K7p/IrBS8+eA4X69bHYYV0UZKDADZSn ardumont@
besp
in"
default
=
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZarzgHrzUYspvrgSI6fszrALo92BDys7QOkJgUfZa9t9m4g7dUANNtwBiqIbqijAQPmB1zKgG6QTZC5rJkRy6KqXCW/+Qeedw/FWIbuI7jOD5WxnglbEQgvPkkB8kf1xIF7icRfWcQmK2je/3sFd9yS4/+jftNMPPXkBCxYm74onMenyllA1akA8FLyujLu6MNA1D8iLLXvz6pBDTT4GZ5/bm3vSE6Go8Xbuyu4SCtYZSHaHC2lXZ6Hhi6dbli4d3OwkUWz+YhFGaEra5Fx45Iig4UCL6kXPkvL/oSc9KGerpT//Xj9qz1K7p/IrBS8+eA4X69bHYYV0UZKDADZSn ardumont@
yav
in
4
"
}
variable
"user_admin"
{
type
=
"string"
default
=
"
ardumon
t"
default
=
"
roo
t"
}
This diff is collapsed.
Click to expand it.
azure/terraform/vault.tf
+
0
−
24
View file @
db27e3d0
# Keyword use:
# - provider: Define the provider(s)
# - data: Retrieve data information to be used within the file
# - resource: Define resource and create/update
# Configure the Microsoft Azure Provider
# Empty if using the `az login` tool
provider
"azurerm"
{
version
=
"~> 1.27"
}
# Reuse the network security group as defined currently
data
"azurerm_network_security_group"
"worker-nsg"
{
name
=
"worker-nsg"
resource_group_name
=
"swh-resource"
}
# Same for the subnet
data
"azurerm_subnet"
"default"
{
name
=
"default"
virtual_network_name
=
"swh-vnet"
resource_group_name
=
"swh-resource"
}
# Define a new resource for the vault
# matching what we name elsewhere "euwest-${resource}"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment