terraform script add
This commit is contained in:
BIN
terraform/.DS_Store
vendored
Normal file
BIN
terraform/.DS_Store
vendored
Normal file
Binary file not shown.
42
terraform/.terraform.lock.hcl
generated
Normal file
42
terraform/.terraform.lock.hcl
generated
Normal file
@@ -0,0 +1,42 @@
|
||||
# This file is maintained automatically by "terraform init".
|
||||
# Manual edits may be lost in future updates.
|
||||
|
||||
provider "registry.terraform.io/hashicorp/local" {
|
||||
version = "2.4.0"
|
||||
hashes = [
|
||||
"h1:ZUEYUmm2t4vxwzxy1BvN1wL6SDWrDxfH7pxtzX8c6d0=",
|
||||
"zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9",
|
||||
"zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf",
|
||||
"zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732",
|
||||
"zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
|
||||
"zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35",
|
||||
"zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04",
|
||||
"zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406",
|
||||
"zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6",
|
||||
"zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7",
|
||||
"zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2",
|
||||
"zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc",
|
||||
"zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce",
|
||||
]
|
||||
}
|
||||
|
||||
provider "registry.terraform.io/navercloudplatform/ncloud" {
|
||||
version = "2.3.18"
|
||||
hashes = [
|
||||
"h1:xZobqEgy/bi3PJPbyTgEtMb3xygWwL33X/hZ6Y8hJco=",
|
||||
"zh:0f6d1510358efbac445102f17bfb2e78d1e5fdcb99cba62d7c3787e793122331",
|
||||
"zh:1c3b57b1500c5855fe1aec27f56caf3b830a96a99c6ab9c6f60841efa101c29d",
|
||||
"zh:37eece6471a9a892b2fa13ff23a99ad00b5fca433298fd992dcb4f34ff256d72",
|
||||
"zh:4218b12614b99d6d1c417e69a014d312b39539d93a7543e489e7265090000367",
|
||||
"zh:5c713ce121bcb84e4d7681194b644e6616a2c8386febad18d3f9fbbdfdae4f1a",
|
||||
"zh:632f7cb0039a193c601c956c1f75038ee8aa6a3a0f65ff8b029f2b366fe4fc93",
|
||||
"zh:75858fef5cdde0be2c4647ff47a86cf8d7c634e9fea160eee13923bc8e446e90",
|
||||
"zh:b597166d921558f87abdeeba0963cb7e89c9b102b5d420bcd148596be2334c96",
|
||||
"zh:ecb28efcbb546a6f3adc968fd70503f2e137b466046b47e585751413114142de",
|
||||
"zh:ed49c5f65f4846104f0265c522c3ebb5c83dadc3ba8d7f692ab3fb1c11dbdb45",
|
||||
"zh:edac83ebd1312883aaf05cecda5048e1bc937c2f7636865b9e67d5dfed64eace",
|
||||
"zh:f251d10efceb8358ee016fb3847e5c1e55ac4ea37502f7d391cfa09d160be114",
|
||||
"zh:f7a2b772123ac0b6b1913d09d1cc363ec47b236416752646f60c3f052f50b17a",
|
||||
"zh:fba4db9b1d7a5e305d3ec1b2371cc22b9ee2722e8c07b79dad9e52bb19a705ef",
|
||||
]
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,28 @@
|
||||
## 1.4.0 (Unreleased)
|
||||
## 1.3.0 (July 09, 2020)
|
||||
|
||||
ENHANCEMENTS:
|
||||
|
||||
* Support "Gov" and "Fin" sites. "Gov" : ncloud for government (www.gov-ncloud.com) / "Fin" : ncloud for finance site (www.fin-ncloud.com). Default: "public" (www.ncloud.com)
|
||||
|
||||
## 1.2.0 (December 18, 2019)
|
||||
|
||||
ENHANCEMENTS:
|
||||
|
||||
* Add a "clean" rule to Makefile
|
||||
|
||||
## 1.1.0 (November 05, 2019)
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
* Migrated to terraform-plugin-sdk (#5)
|
||||
|
||||
## 1.0.0 (October 21, 2019)
|
||||
|
||||
NOTES:
|
||||
|
||||
* Switched to using Go modules(#2)
|
||||
|
||||
## 0.0.1 (March 07, 2019)
|
||||
|
||||
* initial release
|
||||
@@ -0,0 +1,373 @@
|
||||
Mozilla Public License Version 2.0
|
||||
==================================
|
||||
|
||||
1. Definitions
|
||||
--------------
|
||||
|
||||
1.1. "Contributor"
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
|
||||
1.2. "Contributor Version"
|
||||
means the combination of the Contributions of others (if any) used
|
||||
by a Contributor and that particular Contributor's Contribution.
|
||||
|
||||
1.3. "Contribution"
|
||||
means Covered Software of a particular Contributor.
|
||||
|
||||
1.4. "Covered Software"
|
||||
means Source Code Form to which the initial Contributor has attached
|
||||
the notice in Exhibit A, the Executable Form of such Source Code
|
||||
Form, and Modifications of such Source Code Form, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.5. "Incompatible With Secondary Licenses"
|
||||
means
|
||||
|
||||
(a) that the initial Contributor has attached the notice described
|
||||
in Exhibit B to the Covered Software; or
|
||||
|
||||
(b) that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the
|
||||
terms of a Secondary License.
|
||||
|
||||
1.6. "Executable Form"
|
||||
means any form of the work other than Source Code Form.
|
||||
|
||||
1.7. "Larger Work"
|
||||
means a work that combines Covered Software with other material, in
|
||||
a separate file or files, that is not Covered Software.
|
||||
|
||||
1.8. "License"
|
||||
means this document.
|
||||
|
||||
1.9. "Licensable"
|
||||
means having the right to grant, to the maximum extent possible,
|
||||
whether at the time of the initial grant or subsequently, any and
|
||||
all of the rights conveyed by this License.
|
||||
|
||||
1.10. "Modifications"
|
||||
means any of the following:
|
||||
|
||||
(a) any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
|
||||
(b) any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
|
||||
1.11. "Patent Claims" of a Contributor
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
|
||||
1.12. "Secondary License"
|
||||
means either the GNU General Public License, Version 2.0, the GNU
|
||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
||||
Public License, Version 3.0, or any later versions of those
|
||||
licenses.
|
||||
|
||||
1.13. "Source Code Form"
|
||||
means the form of the work preferred for making modifications.
|
||||
|
||||
1.14. "You" (or "Your")
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, "control" means (a) the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (b) ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
|
||||
2. License Grants and Conditions
|
||||
--------------------------------
|
||||
|
||||
2.1. Grants
|
||||
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
|
||||
(a) under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims of such Contributor to make, use, sell, offer
|
||||
for sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
|
||||
2.2. Effective Date
|
||||
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
|
||||
2.3. Limitations on Grant Scope
|
||||
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
|
||||
(a) for any code that a Contributor has removed from Covered Software;
|
||||
or
|
||||
|
||||
(b) for infringements caused by: (i) Your and any other third party's
|
||||
modifications of Covered Software, or (ii) the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
|
||||
(c) under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
|
||||
2.4. Subsequent Licenses
|
||||
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
|
||||
2.5. Representation
|
||||
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights
|
||||
to grant the rights to its Contributions conveyed by this License.
|
||||
|
||||
2.6. Fair Use
|
||||
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
|
||||
2.7. Conditions
|
||||
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
||||
in Section 2.1.
|
||||
|
||||
3. Responsibilities
|
||||
-------------------
|
||||
|
||||
3.1. Distribution of Source Form
|
||||
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
|
||||
3.2. Distribution of Executable Form
|
||||
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
|
||||
(a) such Covered Software must also be made available in Source Code
|
||||
Form, as described in Section 3.1, and You must inform recipients of
|
||||
the Executable Form how they can obtain a copy of such Source Code
|
||||
Form by reasonable means in a timely manner, at a charge no more
|
||||
than the cost of distribution to the recipient; and
|
||||
|
||||
(b) You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter
|
||||
the recipients' rights in the Source Code Form under this License.
|
||||
|
||||
3.3. Distribution of a Larger Work
|
||||
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
|
||||
3.4. Notices
|
||||
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty,
|
||||
or limitations of liability) contained within the Source Code Form of
|
||||
the Covered Software, except that You may alter any license notices to
|
||||
the extent required to remedy known factual inaccuracies.
|
||||
|
||||
3.5. Application of Additional Terms
|
||||
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
---------------------------------------------------
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Software due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description must
|
||||
be placed in a text file included with all distributions of the Covered
|
||||
Software under this License. Except to the extent prohibited by statute
|
||||
or regulation, such description must be sufficiently detailed for a
|
||||
recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Termination
|
||||
--------------
|
||||
|
||||
5.1. The rights granted under this License will terminate automatically
|
||||
if You fail to comply with any of its terms. However, if You become
|
||||
compliant, then the rights granted under this License from a particular
|
||||
Contributor are reinstated (a) provisionally, unless and until such
|
||||
Contributor explicitly and finally terminates Your grants, and (b) on an
|
||||
ongoing basis, if such Contributor fails to notify You of the
|
||||
non-compliance by some reasonable means prior to 60 days after You have
|
||||
come back into compliance. Moreover, Your grants from a particular
|
||||
Contributor are reinstated on an ongoing basis if such Contributor
|
||||
notifies You of the non-compliance by some reasonable means, this is the
|
||||
first time You have received notice of non-compliance with this License
|
||||
from such Contributor, and You become compliant prior to 30 days after
|
||||
Your receipt of the notice.
|
||||
|
||||
5.2. If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under Section
|
||||
2.1 of this License shall terminate.
|
||||
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
||||
end user license agreements (excluding distributors and resellers) which
|
||||
have been validly granted by You or Your distributors under this License
|
||||
prior to termination shall survive termination.
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 6. Disclaimer of Warranty *
|
||||
* ------------------------- *
|
||||
* *
|
||||
* Covered Software is provided under this License on an "as is" *
|
||||
* basis, without warranty of any kind, either expressed, implied, or *
|
||||
* statutory, including, without limitation, warranties that the *
|
||||
* Covered Software is free of defects, merchantable, fit for a *
|
||||
* particular purpose or non-infringing. The entire risk as to the *
|
||||
* quality and performance of the Covered Software is with You. *
|
||||
* Should any Covered Software prove defective in any respect, You *
|
||||
* (not any Contributor) assume the cost of any necessary servicing, *
|
||||
* repair, or correction. This disclaimer of warranty constitutes an *
|
||||
* essential part of this License. No use of any Covered Software is *
|
||||
* authorized under this License except under this disclaimer. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 7. Limitation of Liability *
|
||||
* -------------------------- *
|
||||
* *
|
||||
* Under no circumstances and under no legal theory, whether tort *
|
||||
* (including negligence), contract, or otherwise, shall any *
|
||||
* Contributor, or anyone who distributes Covered Software as *
|
||||
* permitted above, be liable to You for any direct, indirect, *
|
||||
* special, incidental, or consequential damages of any character *
|
||||
* including, without limitation, damages for lost profits, loss of *
|
||||
* goodwill, work stoppage, computer failure or malfunction, or any *
|
||||
* and all other commercial damages or losses, even if such party *
|
||||
* shall have been informed of the possibility of such damages. This *
|
||||
* limitation of liability shall not apply to liability for death or *
|
||||
* personal injury resulting from such party's negligence to the *
|
||||
* extent applicable law prohibits such limitation. Some *
|
||||
* jurisdictions do not allow the exclusion or limitation of *
|
||||
* incidental or consequential damages, so this exclusion and *
|
||||
* limitation may not apply to You. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
8. Litigation
|
||||
-------------
|
||||
|
||||
Any litigation relating to this License may be brought only in the
|
||||
courts of a jurisdiction where the defendant maintains its principal
|
||||
place of business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions.
|
||||
Nothing in this Section shall prevent a party's ability to bring
|
||||
cross-claims or counter-claims.
|
||||
|
||||
9. Miscellaneous
|
||||
----------------
|
||||
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides
|
||||
that the language of a contract shall be construed against the drafter
|
||||
shall not be used to construe this License against a Contributor.
|
||||
|
||||
10. Versions of the License
|
||||
---------------------------
|
||||
|
||||
10.1. New Versions
|
||||
|
||||
Mozilla Foundation is the license steward. Except as provided in Section
|
||||
10.3, no one other than the license steward has the right to modify or
|
||||
publish new versions of this License. Each version will be given a
|
||||
distinguishing version number.
|
||||
|
||||
10.2. Effect of New Versions
|
||||
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
|
||||
10.3. Modified Versions
|
||||
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
|
||||
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
||||
Licenses
|
||||
|
||||
If You choose to distribute Source Code Form that is Incompatible With
|
||||
Secondary Licenses under the terms of this version of the License, the
|
||||
notice described in Exhibit B of this License must be attached.
|
||||
|
||||
Exhibit A - Source Code Form License Notice
|
||||
-------------------------------------------
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
If it is not possible or desirable to put the notice in a particular
|
||||
file, then You may include the notice in a location (such as a LICENSE
|
||||
file in a relevant directory) where a recipient would be likely to look
|
||||
for such a notice.
|
||||
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
|
||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
||||
---------------------------------------------------------
|
||||
|
||||
This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
defined by the Mozilla Public License, v. 2.0.
|
||||
@@ -0,0 +1,64 @@
|
||||
# Terraform Provider for Naver Cloud Platform
|
||||
|
||||
- Website: https://www.terraform.io
|
||||
- Documentation: https://www.terraform.io/docs/providers/ncloud/index.html
|
||||
- [](https://gitter.im/hashicorp-terraform/Lobby)
|
||||
- Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool)
|
||||
|
||||
<img src="https://cdn.jsdelivr.net/gh/hashicorp/terraform-website@master/public/img/logo-hashicorp.svg" width="600px">
|
||||
|
||||
## Requirements
|
||||
|
||||
- [Terraform](https://www.terraform.io/downloads.html) 0.13.x
|
||||
- [Go](https://golang.org/doc/install) v1.19.x (to build the provider plugin)
|
||||
|
||||
## Building The Provider
|
||||
|
||||
Clone repository to: `$GOPATH/src/github.com/NaverCloudPlatform/terraform-provider-ncloud`
|
||||
|
||||
```sh
|
||||
$ mkdir -p $GOPATH/src/github.com/NaverCloudPlatform; cd $GOPATH/src/github.com/NaverCloudPlatform
|
||||
$ git clone git@github.com:NaverCloudPlatform/terraform-provider-ncloud.git
|
||||
```
|
||||
|
||||
Enter the provider directory and build the provider
|
||||
|
||||
```sh
|
||||
$ cd $GOPATH/src/github.com/NaverCloudPlatform/terraform-provider-ncloud
|
||||
$ make build
|
||||
```
|
||||
|
||||
## Using the provider
|
||||
|
||||
See the [Naver Cloud Platform Provider documentation](http://www.terraform.io/docs/providers/ncloud/index.html) to get started using the Naver Cloud Platform provider.
|
||||
|
||||
## Upgrading the provider
|
||||
|
||||
To upgrade to the latest stable version of the Naver Cloud Platform provider run `terraform init -upgrade`. See the [Terraform website](https://www.terraform.io/docs/configuration/providers.html#provider-versions) for more information.
|
||||
|
||||
## Developing the Provider
|
||||
|
||||
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.11+ is _required_). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.
|
||||
|
||||
To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
|
||||
|
||||
```sh
|
||||
$ make build
|
||||
...
|
||||
$ $GOPATH/bin/terraform-provider-ncloud
|
||||
...
|
||||
```
|
||||
|
||||
In order to test the provider, you can simply run `make test`.
|
||||
|
||||
```sh
|
||||
$ make test
|
||||
```
|
||||
|
||||
In order to run the full suite of Acceptance tests, run `make testacc`.
|
||||
|
||||
_Note:_ Acceptance tests create real resources, and often cost money to run.
|
||||
|
||||
```sh
|
||||
$ make testacc
|
||||
```
|
||||
Binary file not shown.
37
terraform/lb.tf
Normal file
37
terraform/lb.tf
Normal file
@@ -0,0 +1,37 @@
|
||||
resource "ncloud_lb" "jh-ncloud-test-lb" {
|
||||
name = "kube-api-server-lb"
|
||||
network_type = "PRIVATE"
|
||||
type = "APPLICATION"
|
||||
subnet_no_list = [ ncloud_subnet.loadbalancer_subnet.subnet_no ]
|
||||
}
|
||||
|
||||
resource "ncloud_lb_target_group" "jh-ncloud-test-lb-group" {
|
||||
vpc_no = ncloud_vpc.jh-test-ncloud-vpc.vpc_no
|
||||
protocol = "HTTPS"
|
||||
target_type = "VSVR"
|
||||
port = 6443
|
||||
|
||||
health_check {
|
||||
protocol = "HTTPS"
|
||||
http_method = "GET"
|
||||
port = 6443
|
||||
url_path = "/livez?verbose"
|
||||
cycle = 30
|
||||
up_threshold = 3
|
||||
down_threshold = 3
|
||||
}
|
||||
algorithm_type = "RR"
|
||||
}
|
||||
|
||||
resource "ncloud_lb_target_group_attachment" "jh-ncloud-test-lb-attach" {
|
||||
target_group_no = ncloud_lb_target_group.jh-ncloud-test-lb-group.target_group_no
|
||||
target_no_list = [ ncloud_server.jh-test-ncloud-master.instance_no ]
|
||||
}
|
||||
|
||||
resource "ncloud_lb_listener" "jh-ncloud-test-lb-listener" {
|
||||
load_balancer_no = ncloud_lb.jh-ncloud-test-lb.load_balancer_no
|
||||
protocol = "HTTPS"
|
||||
port = 6443
|
||||
target_group_no = ncloud_lb_target_group.jh-ncloud-test-lb-group.target_group_no
|
||||
ssl_certificate_no = 20941
|
||||
}
|
||||
17
terraform/ncloud.tf
Normal file
17
terraform/ncloud.tf
Normal file
@@ -0,0 +1,17 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
ncloud = {
|
||||
source = "NaverCloudPlatform/ncloud"
|
||||
}
|
||||
}
|
||||
required_version = ">= 0.13"
|
||||
}
|
||||
|
||||
// Configure the ncloud provider
|
||||
provider "ncloud" {
|
||||
access_key = var.access_key
|
||||
secret_key = var.secret_key
|
||||
region = var.region
|
||||
site = "public"
|
||||
support_vpc = true
|
||||
}
|
||||
3
terraform/public_ip.tf
Normal file
3
terraform/public_ip.tf
Normal file
@@ -0,0 +1,3 @@
|
||||
resource "ncloud_public_ip" "bastion-public-ip" {
|
||||
server_instance_no = ncloud_server.jh-test-ncloud-bastion.id
|
||||
}
|
||||
39
terraform/route.tf
Normal file
39
terraform/route.tf
Normal file
@@ -0,0 +1,39 @@
|
||||
resource "ncloud_route_table" "jh-test-ncloud-rt-private" {
|
||||
vpc_no = ncloud_vpc.jh-test-ncloud-vpc.id
|
||||
supported_subnet_type = "PRIVATE"
|
||||
name = "jh-test-cloud-rt-private"
|
||||
}
|
||||
|
||||
resource "ncloud_route_table" "jh-test-ncloud-rt-public" {
|
||||
vpc_no = ncloud_vpc.jh-test-ncloud-vpc.id
|
||||
supported_subnet_type = "PUBLIC"
|
||||
name = "jh-test-cloud-rt-public"
|
||||
}
|
||||
|
||||
resource "ncloud_route" "jh-test-ncloud-route-gw" {
|
||||
route_table_no = ncloud_route_table.jh-test-ncloud-rt-private.id
|
||||
destination_cidr_block = "0.0.0.0/0"
|
||||
target_type = "NATGW"
|
||||
target_name = ncloud_nat_gateway.jh-test-ncloud-netgw.name
|
||||
target_no = ncloud_nat_gateway.jh-test-ncloud-netgw.id
|
||||
}
|
||||
|
||||
resource "ncloud_route_table_association" "jh-test-ncloud-route-ass-private" {
|
||||
route_table_no = ncloud_route_table.jh-test-ncloud-rt-private.id
|
||||
subnet_no = ncloud_subnet.jh-test-ncloud-subnet.id
|
||||
}
|
||||
|
||||
resource "ncloud_route_table_association" "jh-test-ncloud-route-ass-lb" {
|
||||
route_table_no = ncloud_route_table.jh-test-ncloud-rt-private.id
|
||||
subnet_no = ncloud_subnet.loadbalancer_subnet.id
|
||||
}
|
||||
|
||||
resource "ncloud_route_table_association" "jh-test-ncloud-route-ass-public" {
|
||||
route_table_no = ncloud_route_table.jh-test-ncloud-rt-public.id
|
||||
subnet_no = ncloud_subnet.jh-test-ncloud-subnet-public.id
|
||||
}
|
||||
|
||||
resource "ncloud_route_table_association" "jh-test-ncloud-route-ass-natgw" {
|
||||
route_table_no = ncloud_route_table.jh-test-ncloud-rt-public.id
|
||||
subnet_no = ncloud_subnet.natgateway_subnet.id
|
||||
}
|
||||
50
terraform/server.tf
Normal file
50
terraform/server.tf
Normal file
@@ -0,0 +1,50 @@
|
||||
resource "ncloud_init_script" "dsk-node-ssh-key" {
|
||||
name = "dsk-node-ssh-key"
|
||||
content = "echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDRP/Kjn7UBudTO4ZLtWXRJNDcOPGbm+5jLKax+1tVgN2n0MCmwwrbFJQJvdaE/wp4+PnMtEyt+IqdwFdUDah8tu9CIYZ2Jk2T18oU7hYGvymh+QJmZgCNvYcmM9ATJbXpns7y8VLDVbkSq9EJIB+emLt1ZV/C8cyvhlmBUwGQA6c3zMgzWl9MT0HLa7H88cNVVknZPY0vGIw+H0Y2JtDr62xyVNT7w8B+jh7Yu6nCnQchwx3IRWGATuKfi2FB3rhkDqNvM1h00JJosu5ooBn3g5xll+w+sVKIQxEWShI9zatYP9/zrce+uVYeZLfz52X8giJ9dns66vqEKdJtdp4By5RPxRSsdQ2QGAQ0UuBHKgweU2EzivLynu49oiShAiJPxmru4TiGtchl52dvw/E9rjZiCKTq697azHHLbwTiOgbHpnu7GrxNRMdXCON70RYJpfERg/SGxxmUNF9OhYUeQJGNc8DcWnlBUrT/9Wi3Ryh1rKx2wtZt6eDkrehJ1lgU= byeonjunghun@byeonjeonghun-ui-Macmini.local' >> ~/.ssh/authorized_keys"
|
||||
}
|
||||
|
||||
resource "ncloud_login_key" "dsk-test-key" { // 인증키 설정
|
||||
key_name = "dsk-test-key"
|
||||
}
|
||||
|
||||
resource "local_file" "ssh_key" {
|
||||
filename = "${ncloud_login_key.dsk-test-key.key_name}.pem"
|
||||
content = ncloud_login_key.dsk-test-key.private_key
|
||||
}
|
||||
|
||||
resource "ncloud_server" "jh-test-ncloud-bastion" {
|
||||
subnet_no = ncloud_subnet.jh-test-ncloud-subnet-public.id
|
||||
name = "bastion"
|
||||
#server_image_product_code = "SW.VSVR.OS.LNX64.UBNTU.SVR2004.B050"
|
||||
member_server_image_no = 20108119
|
||||
server_product_code = "SVR.VSVR.HICPU.C002.M004.NET.SSD.B050.G002"
|
||||
login_key_name = ncloud_login_key.dsk-test-key.key_name
|
||||
init_script_no = ncloud_init_script.dsk-node-ssh-key.init_script_no
|
||||
}
|
||||
|
||||
resource "ncloud_server" "jh-test-ncloud-master" {
|
||||
subnet_no = ncloud_subnet.jh-test-ncloud-subnet.id
|
||||
name = "master"
|
||||
#server_image_product_code = "SW.VSVR.OS.LNX64.UBNTU.SVR2004.B050"
|
||||
member_server_image_no = 20108119
|
||||
server_product_code = "SVR.VSVR.HICPU.C002.M004.NET.SSD.B050.G002"
|
||||
login_key_name = ncloud_login_key.dsk-test-key.key_name
|
||||
}
|
||||
|
||||
resource "ncloud_server" "jh-test-ncloud-worker-1" {
|
||||
subnet_no = ncloud_subnet.jh-test-ncloud-subnet.id
|
||||
name = "worker-1"
|
||||
#server_image_product_code = "SW.VSVR.OS.LNX64.UBNTU.SVR2004.B050"
|
||||
member_server_image_no = 20108119
|
||||
server_product_code = "SVR.VSVR.HICPU.C002.M004.NET.SSD.B050.G002"
|
||||
login_key_name = ncloud_login_key.dsk-test-key.key_name
|
||||
}
|
||||
|
||||
resource "ncloud_server" "jh-test-ncloud-worker-2" {
|
||||
subnet_no = ncloud_subnet.jh-test-ncloud-subnet.id
|
||||
name = "worker-2"
|
||||
#server_image_product_code = "SW.VSVR.OS.LNX64.UBNTU.SVR2004.B050"
|
||||
member_server_image_no = 20108119
|
||||
server_product_code = "SVR.VSVR.HICPU.C002.M004.NET.SSD.B050.G002"
|
||||
login_key_name = ncloud_login_key.dsk-test-key.key_name
|
||||
}
|
||||
428
terraform/terraform.tfstate
Normal file
428
terraform/terraform.tfstate
Normal file
@@ -0,0 +1,428 @@
|
||||
{
|
||||
"version": 4,
|
||||
"terraform_version": "1.4.6",
|
||||
"serial": 253,
|
||||
"lineage": "cbcad2ae-0d6e-3dd6-8d21-54b24fd937e0",
|
||||
"outputs": {},
|
||||
"resources": [
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "ncloud_nat_gateway",
|
||||
"name": "jh-test-ncloud-netgw",
|
||||
"provider": "provider[\"registry.terraform.io/navercloudplatform/ncloud\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"description": "",
|
||||
"id": "20106584",
|
||||
"name": "jh-test-ncloud-netgw",
|
||||
"nat_gateway_no": "20106584",
|
||||
"private_ip": "10.40.30.6",
|
||||
"public_ip": "223.130.131.167",
|
||||
"public_ip_no": "20106586",
|
||||
"subnet_name": "natgateway-subnet",
|
||||
"subnet_no": "109067",
|
||||
"vpc_no": "48720",
|
||||
"zone": "KR-2"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"ncloud_network_acl.jh-test-ncloud-acl",
|
||||
"ncloud_subnet.natgateway_subnet",
|
||||
"ncloud_vpc.jh-test-ncloud-vpc"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "ncloud_network_acl",
|
||||
"name": "jh-test-ncloud-acl",
|
||||
"provider": "provider[\"registry.terraform.io/navercloudplatform/ncloud\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"description": "",
|
||||
"id": "74573",
|
||||
"is_default": false,
|
||||
"name": "jh-test-ncloud-acl",
|
||||
"network_acl_no": "74573",
|
||||
"vpc_no": "48720"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"ncloud_vpc.jh-test-ncloud-vpc"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "ncloud_network_acl_rule",
|
||||
"name": "jh-test-ncloud-acl-list",
|
||||
"provider": "provider[\"registry.terraform.io/navercloudplatform/ncloud\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"id": "74573",
|
||||
"inbound": [
|
||||
{
|
||||
"deny_allow_group_no": "",
|
||||
"description": "",
|
||||
"ip_block": "0.0.0.0/0",
|
||||
"port_range": "443",
|
||||
"priority": 1,
|
||||
"protocol": "TCP",
|
||||
"rule_action": "ALLOW"
|
||||
},
|
||||
{
|
||||
"deny_allow_group_no": "",
|
||||
"description": "",
|
||||
"ip_block": "118.223.123.161/32",
|
||||
"port_range": "22",
|
||||
"priority": 0,
|
||||
"protocol": "TCP",
|
||||
"rule_action": "ALLOW"
|
||||
}
|
||||
],
|
||||
"network_acl_no": "74573",
|
||||
"outbound": [
|
||||
{
|
||||
"deny_allow_group_no": "",
|
||||
"description": "",
|
||||
"ip_block": "0.0.0.0/0",
|
||||
"port_range": "1-65535",
|
||||
"priority": 0,
|
||||
"protocol": "TCP",
|
||||
"rule_action": "ALLOW"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"ncloud_network_acl.jh-test-ncloud-acl",
|
||||
"ncloud_vpc.jh-test-ncloud-vpc"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "ncloud_route",
|
||||
"name": "jh-test-ncloud-route-gw",
|
||||
"provider": "provider[\"registry.terraform.io/navercloudplatform/ncloud\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"destination_cidr_block": "0.0.0.0/0",
|
||||
"id": "route-1215077076",
|
||||
"is_default": false,
|
||||
"route_table_no": "102803",
|
||||
"target_name": "jh-test-ncloud-netgw",
|
||||
"target_no": "20106584",
|
||||
"target_type": "NATGW",
|
||||
"vpc_no": "48720"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"ncloud_nat_gateway.jh-test-ncloud-netgw",
|
||||
"ncloud_network_acl.jh-test-ncloud-acl",
|
||||
"ncloud_route_table.jh-test-ncloud-rt-private",
|
||||
"ncloud_subnet.natgateway_subnet",
|
||||
"ncloud_vpc.jh-test-ncloud-vpc"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "ncloud_route_table",
|
||||
"name": "jh-test-ncloud-rt-private",
|
||||
"provider": "provider[\"registry.terraform.io/navercloudplatform/ncloud\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"description": "",
|
||||
"id": "102803",
|
||||
"is_default": false,
|
||||
"name": "jh-test-cloud-rt-private",
|
||||
"route_table_no": "102803",
|
||||
"supported_subnet_type": "PRIVATE",
|
||||
"vpc_no": "48720"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"ncloud_vpc.jh-test-ncloud-vpc"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "ncloud_route_table",
|
||||
"name": "jh-test-ncloud-rt-public",
|
||||
"provider": "provider[\"registry.terraform.io/navercloudplatform/ncloud\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"description": "",
|
||||
"id": "102802",
|
||||
"is_default": false,
|
||||
"name": "jh-test-cloud-rt-public",
|
||||
"route_table_no": "102802",
|
||||
"supported_subnet_type": "PUBLIC",
|
||||
"vpc_no": "48720"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"ncloud_vpc.jh-test-ncloud-vpc"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "ncloud_route_table_association",
|
||||
"name": "jh-test-ncloud-route-ass-lb",
|
||||
"provider": "provider[\"registry.terraform.io/navercloudplatform/ncloud\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"id": "102803:109065",
|
||||
"route_table_no": "102803",
|
||||
"subnet_no": "109065"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"ncloud_network_acl.jh-test-ncloud-acl",
|
||||
"ncloud_route_table.jh-test-ncloud-rt-private",
|
||||
"ncloud_subnet.loadbalancer_subnet",
|
||||
"ncloud_vpc.jh-test-ncloud-vpc"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "ncloud_route_table_association",
|
||||
"name": "jh-test-ncloud-route-ass-natgw",
|
||||
"provider": "provider[\"registry.terraform.io/navercloudplatform/ncloud\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"id": "102802:109067",
|
||||
"route_table_no": "102802",
|
||||
"subnet_no": "109067"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"ncloud_network_acl.jh-test-ncloud-acl",
|
||||
"ncloud_route_table.jh-test-ncloud-rt-public",
|
||||
"ncloud_subnet.natgateway_subnet",
|
||||
"ncloud_vpc.jh-test-ncloud-vpc"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "ncloud_route_table_association",
|
||||
"name": "jh-test-ncloud-route-ass-private",
|
||||
"provider": "provider[\"registry.terraform.io/navercloudplatform/ncloud\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"id": "102803:109068",
|
||||
"route_table_no": "102803",
|
||||
"subnet_no": "109068"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"ncloud_network_acl.jh-test-ncloud-acl",
|
||||
"ncloud_route_table.jh-test-ncloud-rt-private",
|
||||
"ncloud_subnet.jh-test-ncloud-subnet",
|
||||
"ncloud_vpc.jh-test-ncloud-vpc"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "ncloud_route_table_association",
|
||||
"name": "jh-test-ncloud-route-ass-public",
|
||||
"provider": "provider[\"registry.terraform.io/navercloudplatform/ncloud\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"id": "102802:109066",
|
||||
"route_table_no": "102802",
|
||||
"subnet_no": "109066"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"ncloud_network_acl.jh-test-ncloud-acl",
|
||||
"ncloud_route_table.jh-test-ncloud-rt-public",
|
||||
"ncloud_subnet.jh-test-ncloud-subnet-public",
|
||||
"ncloud_vpc.jh-test-ncloud-vpc"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "ncloud_subnet",
|
||||
"name": "jh-test-ncloud-subnet",
|
||||
"provider": "provider[\"registry.terraform.io/navercloudplatform/ncloud\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"id": "109068",
|
||||
"name": "private-subnet",
|
||||
"network_acl_no": "74573",
|
||||
"subnet": "10.40.10.0/24",
|
||||
"subnet_no": "109068",
|
||||
"subnet_type": "PRIVATE",
|
||||
"usage_type": "GEN",
|
||||
"vpc_no": "48720",
|
||||
"zone": "KR-2"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"ncloud_network_acl.jh-test-ncloud-acl",
|
||||
"ncloud_vpc.jh-test-ncloud-vpc"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "ncloud_subnet",
|
||||
"name": "jh-test-ncloud-subnet-public",
|
||||
"provider": "provider[\"registry.terraform.io/navercloudplatform/ncloud\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"id": "109066",
|
||||
"name": "public-subnet",
|
||||
"network_acl_no": "74573",
|
||||
"subnet": "10.40.20.0/24",
|
||||
"subnet_no": "109066",
|
||||
"subnet_type": "PUBLIC",
|
||||
"usage_type": "GEN",
|
||||
"vpc_no": "48720",
|
||||
"zone": "KR-2"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"ncloud_network_acl.jh-test-ncloud-acl",
|
||||
"ncloud_vpc.jh-test-ncloud-vpc"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "ncloud_subnet",
|
||||
"name": "loadbalancer_subnet",
|
||||
"provider": "provider[\"registry.terraform.io/navercloudplatform/ncloud\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"id": "109065",
|
||||
"name": "loadbalancer-subnet",
|
||||
"network_acl_no": "74573",
|
||||
"subnet": "10.40.40.0/24",
|
||||
"subnet_no": "109065",
|
||||
"subnet_type": "PRIVATE",
|
||||
"usage_type": "LOADB",
|
||||
"vpc_no": "48720",
|
||||
"zone": "KR-2"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"ncloud_network_acl.jh-test-ncloud-acl",
|
||||
"ncloud_vpc.jh-test-ncloud-vpc"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "ncloud_subnet",
|
||||
"name": "natgateway_subnet",
|
||||
"provider": "provider[\"registry.terraform.io/navercloudplatform/ncloud\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"id": "109067",
|
||||
"name": "natgateway-subnet",
|
||||
"network_acl_no": "74573",
|
||||
"subnet": "10.40.30.0/24",
|
||||
"subnet_no": "109067",
|
||||
"subnet_type": "PUBLIC",
|
||||
"usage_type": "NATGW",
|
||||
"vpc_no": "48720",
|
||||
"zone": "KR-2"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"ncloud_network_acl.jh-test-ncloud-acl",
|
||||
"ncloud_vpc.jh-test-ncloud-vpc"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "ncloud_vpc",
|
||||
"name": "jh-test-ncloud-vpc",
|
||||
"provider": "provider[\"registry.terraform.io/navercloudplatform/ncloud\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"default_access_control_group_no": "135939",
|
||||
"default_network_acl_no": "74572",
|
||||
"default_private_route_table_no": "102801",
|
||||
"default_public_route_table_no": "102800",
|
||||
"id": "48720",
|
||||
"ipv4_cidr_block": "10.40.0.0/16",
|
||||
"name": "jh-test-cidr",
|
||||
"vpc_no": "48720"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA=="
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"check_results": null
|
||||
}
|
||||
9
terraform/terraform.tfstate.backup
Normal file
9
terraform/terraform.tfstate.backup
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"version": 4,
|
||||
"terraform_version": "1.4.6",
|
||||
"serial": 237,
|
||||
"lineage": "cbcad2ae-0d6e-3dd6-8d21-54b24fd937e0",
|
||||
"outputs": {},
|
||||
"resources": [],
|
||||
"check_results": null
|
||||
}
|
||||
11
terraform/variables.tf
Normal file
11
terraform/variables.tf
Normal file
@@ -0,0 +1,11 @@
|
||||
variable "access_key" {
|
||||
default = "fHrc64JJfNV9pLVUMIsQ"
|
||||
}
|
||||
|
||||
variable "secret_key" {
|
||||
default = "93qernzjJp9CKuGkXLlHxQNn2bkxIKauzCkBjrw4"
|
||||
}
|
||||
|
||||
variable "region" {
|
||||
default = "KR"
|
||||
}
|
||||
85
terraform/vpc.tf
Normal file
85
terraform/vpc.tf
Normal file
@@ -0,0 +1,85 @@
|
||||
resource "ncloud_vpc" "jh-test-ncloud-vpc" { //VPC 생성
|
||||
ipv4_cidr_block = "10.40.0.0/16"
|
||||
name = "jh-test-cidr"
|
||||
}
|
||||
|
||||
resource "ncloud_network_acl" "jh-test-ncloud-acl" { //접근 제어 목록
|
||||
vpc_no = ncloud_vpc.jh-test-ncloud-vpc.id
|
||||
name = "jh-test-ncloud-acl"
|
||||
}
|
||||
|
||||
resource "ncloud_network_acl_rule" "jh-test-ncloud-acl-list" { // 접근 제어 룰
|
||||
network_acl_no = ncloud_network_acl.jh-test-ncloud-acl.id
|
||||
|
||||
inbound { // 인바운드 규칙
|
||||
priority = 0
|
||||
protocol = "TCP"
|
||||
rule_action = "ALLOW"
|
||||
ip_block = "118.223.123.161/32"
|
||||
port_range = "22"
|
||||
}
|
||||
|
||||
inbound { // 인바운드 규칙
|
||||
priority = 1
|
||||
protocol = "TCP"
|
||||
rule_action = "ALLOW"
|
||||
ip_block = "0.0.0.0/0"
|
||||
port_range = "443"
|
||||
}
|
||||
|
||||
outbound { // 아웃바운드 규칙
|
||||
priority = 0
|
||||
protocol = "TCP"
|
||||
rule_action = "ALLOW"
|
||||
ip_block = "0.0.0.0/0"
|
||||
port_range = "1-65535"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resource "ncloud_subnet" "jh-test-ncloud-subnet" { // node용 프라이빗 서브넷 생성
|
||||
vpc_no = ncloud_vpc.jh-test-ncloud-vpc.id
|
||||
subnet = "10.40.10.0/24"
|
||||
zone = "KR-2"
|
||||
subnet_type = "PRIVATE"
|
||||
name = "private-subnet"
|
||||
usage_type = "GEN"
|
||||
network_acl_no = ncloud_network_acl.jh-test-ncloud-acl.id
|
||||
}
|
||||
|
||||
resource "ncloud_subnet" "jh-test-ncloud-subnet-public" { // node용 퍼블릭 서브넷 생성
|
||||
vpc_no = ncloud_vpc.jh-test-ncloud-vpc.id
|
||||
subnet = "10.40.20.0/24"
|
||||
zone = "KR-2"
|
||||
subnet_type = "PUBLIC"
|
||||
name = "public-subnet"
|
||||
usage_type = "GEN"
|
||||
network_acl_no = ncloud_network_acl.jh-test-ncloud-acl.id
|
||||
}
|
||||
|
||||
resource "ncloud_subnet" "natgateway_subnet" { // NATGW용 퍼블릭 서브넷 생성
|
||||
vpc_no = ncloud_vpc.jh-test-ncloud-vpc.id
|
||||
subnet = "10.40.30.0/24"
|
||||
zone = "KR-2"
|
||||
subnet_type = "PUBLIC"
|
||||
name = "natgateway-subnet"
|
||||
usage_type = "NATGW"
|
||||
network_acl_no = ncloud_network_acl.jh-test-ncloud-acl.id
|
||||
}
|
||||
|
||||
resource "ncloud_subnet" "loadbalancer_subnet" { // LoadBalancer용 퍼블릭 서브넷
|
||||
vpc_no = ncloud_vpc.jh-test-ncloud-vpc.id
|
||||
subnet = "10.40.40.0/24"
|
||||
zone = "KR-2"
|
||||
subnet_type = "PRIVATE"
|
||||
name = "loadbalancer-subnet"
|
||||
usage_type = "LOADB"
|
||||
network_acl_no = ncloud_network_acl.jh-test-ncloud-acl.id
|
||||
}
|
||||
|
||||
resource "ncloud_nat_gateway" "jh-test-ncloud-netgw" { //NATGW 생성
|
||||
vpc_no = ncloud_vpc.jh-test-ncloud-vpc.id
|
||||
subnet_no = ncloud_subnet.natgateway_subnet.id
|
||||
zone = "KR-2"
|
||||
name = "jh-test-ncloud-netgw"
|
||||
}
|
||||
Reference in New Issue
Block a user