├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── main.yml ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── NOTICE ├── README.md ├── gcp_commands.md └── main.tf /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Codeowners for these exercise files: 2 | # * (asterisk) denotes "all files and folders" 3 | # Example: * @producer @instructor 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 7 | 8 | ## Issue Overview 9 | 10 | 11 | ## Describe your environment 12 | 13 | 14 | ## Steps to Reproduce 15 | 16 | 1. 17 | 2. 18 | 3. 19 | 4. 20 | 21 | ## Expected Behavior 22 | 23 | 24 | ## Current Behavior 25 | 26 | 27 | ## Possible Solution 28 | 29 | 30 | ## Screenshots / Video 31 | 32 | 33 | ## Related Issues 34 | 35 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Copy To Branches 2 | on: 3 | workflow_dispatch: 4 | jobs: 5 | copy-to-branches: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v2 9 | with: 10 | fetch-depth: 0 11 | - name: Copy To Branches Action 12 | uses: planetoftheweb/copy-to-branches@v1.2 13 | env: 14 | key: main 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | .tmp 4 | npm-debug.log 5 | *.sh 6 | *.terraform 7 | *.pem 8 | *.tfvars 9 | *.tfplan 10 | *.tfstate 11 | *.tfstate.backup 12 | *.lock.info 13 | .terraform 14 | .DS_Store 15 | *.hcl 16 | tf_sa_key -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | Contribution Agreement 3 | ====================== 4 | 5 | This repository does not accept pull requests (PRs). All pull requests will be closed. 6 | 7 | However, if any contributions (through pull requests, issues, feedback or otherwise) are provided, as a contributor, you represent that the code you submit is your original work or that of your employer (in which case you represent you have the right to bind your employer). By submitting code (or otherwise providing feedback), you (and, if applicable, your employer) are licensing the submitted code (and/or feedback) to LinkedIn and the open source community subject to the BSD 2-Clause license. 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | LinkedIn Learning Exercise Files License Agreement 2 | ================================================== 3 | 4 | This License Agreement (the "Agreement") is a binding legal agreement 5 | between you (as an individual or entity, as applicable) and LinkedIn 6 | Corporation (“LinkedIn”). By downloading or using the LinkedIn Learning 7 | exercise files in this repository (“Licensed Materials”), you agree to 8 | be bound by the terms of this Agreement. If you do not agree to these 9 | terms, do not download or use the Licensed Materials. 10 | 11 | 1. License. 12 | - a. Subject to the terms of this Agreement, LinkedIn hereby grants LinkedIn 13 | members during their LinkedIn Learning subscription a non-exclusive, 14 | non-transferable copyright license, for internal use only, to 1) make a 15 | reasonable number of copies of the Licensed Materials, and 2) make 16 | derivative works of the Licensed Materials for the sole purpose of 17 | practicing skills taught in LinkedIn Learning courses. 18 | - b. Distribution. Unless otherwise noted in the Licensed Materials, subject 19 | to the terms of this Agreement, LinkedIn hereby grants LinkedIn members 20 | with a LinkedIn Learning subscription a non-exclusive, non-transferable 21 | copyright license to distribute the Licensed Materials, except the 22 | Licensed Materials may not be included in any product or service (or 23 | otherwise used) to instruct or educate others. 24 | 25 | 2. Restrictions and Intellectual Property. 26 | - a. You may not to use, modify, copy, make derivative works of, publish, 27 | distribute, rent, lease, sell, sublicense, assign or otherwise transfer the 28 | Licensed Materials, except as expressly set forth above in Section 1. 29 | - b. Linkedin (and its licensors) retains its intellectual property rights 30 | in the Licensed Materials. Except as expressly set forth in Section 1, 31 | LinkedIn grants no licenses. 32 | - c. You indemnify LinkedIn and its licensors and affiliates for i) any 33 | alleged infringement or misappropriation of any intellectual property rights 34 | of any third party based on modifications you make to the Licensed Materials, 35 | ii) any claims arising from your use or distribution of all or part of the 36 | Licensed Materials and iii) a breach of this Agreement. You will defend, hold 37 | harmless, and indemnify LinkedIn and its affiliates (and our and their 38 | respective employees, shareholders, and directors) from any claim or action 39 | brought by a third party, including all damages, liabilities, costs and 40 | expenses, including reasonable attorneys’ fees, to the extent resulting from, 41 | alleged to have resulted from, or in connection with: (a) your breach of your 42 | obligations herein; or (b) your use or distribution of any Licensed Materials. 43 | 44 | 3. Open source. This code may include open source software, which may be 45 | subject to other license terms as provided in the files. 46 | 47 | 4. Warranty Disclaimer. LINKEDIN PROVIDES THE LICENSED MATERIALS ON AN “AS IS” 48 | AND “AS AVAILABLE” BASIS. LINKEDIN MAKES NO REPRESENTATION OR WARRANTY, 49 | WHETHER EXPRESS OR IMPLIED, ABOUT THE LICENSED MATERIALS, INCLUDING ANY 50 | REPRESENTATION THAT THE LICENSED MATERIALS WILL BE FREE OF ERRORS, BUGS OR 51 | INTERRUPTIONS, OR THAT THE LICENSED MATERIALS ARE ACCURATE, COMPLETE OR 52 | OTHERWISE VALID. TO THE FULLEST EXTENT PERMITTED BY LAW, LINKEDIN AND ITS 53 | AFFILIATES DISCLAIM ANY IMPLIED OR STATUTORY WARRANTY OR CONDITION, INCLUDING 54 | ANY IMPLIED WARRANTY OR CONDITION OF MERCHANTABILITY OR FITNESS FOR A 55 | PARTICULAR PURPOSE, AVAILABILITY, SECURITY, TITLE AND/OR NON-INFRINGEMENT. 56 | YOUR USE OF THE LICENSED MATERIALS IS AT YOUR OWN DISCRETION AND RISK, AND 57 | YOU WILL BE SOLELY RESPONSIBLE FOR ANY DAMAGE THAT RESULTS FROM USE OF THE 58 | LICENSED MATERIALS TO YOUR COMPUTER SYSTEM OR LOSS OF DATA. NO ADVICE OR 59 | INFORMATION, WHETHER ORAL OR WRITTEN, OBTAINED BY YOU FROM US OR THROUGH OR 60 | FROM THE LICENSED MATERIALS WILL CREATE ANY WARRANTY OR CONDITION NOT 61 | EXPRESSLY STATED IN THESE TERMS. 62 | 63 | 5. Limitation of Liability. LINKEDIN SHALL NOT BE LIABLE FOR ANY INDIRECT, 64 | INCIDENTAL, SPECIAL, PUNITIVE, CONSEQUENTIAL OR EXEMPLARY DAMAGES, INCLUDING 65 | BUT NOT LIMITED TO, DAMAGES FOR LOSS OF PROFITS, GOODWILL, USE, DATA OR OTHER 66 | INTANGIBLE LOSSES . IN NO EVENT WILL LINKEDIN'S AGGREGATE LIABILITY TO YOU 67 | EXCEED $100. THIS LIMITATION OF LIABILITY SHALL: 68 | - i. APPLY REGARDLESS OF WHETHER (A) YOU BASE YOUR CLAIM ON CONTRACT, TORT, 69 | STATUTE, OR ANY OTHER LEGAL THEORY, (B) WE KNEW OR SHOULD HAVE KNOWN ABOUT 70 | THE POSSIBILITY OF SUCH DAMAGES, OR (C) THE LIMITED REMEDIES PROVIDED IN THIS 71 | SECTION FAIL OF THEIR ESSENTIAL PURPOSE; AND 72 | - ii. NOT APPLY TO ANY DAMAGE THAT LINKEDIN MAY CAUSE YOU INTENTIONALLY OR 73 | KNOWINGLY IN VIOLATION OF THESE TERMS OR APPLICABLE LAW, OR AS OTHERWISE 74 | MANDATED BY APPLICABLE LAW THAT CANNOT BE DISCLAIMED IN THESE TERMS. 75 | 76 | 6. Termination. This Agreement automatically terminates upon your breach of 77 | this Agreement or termination of your LinkedIn Learning subscription. On 78 | termination, all licenses granted under this Agreement will terminate 79 | immediately and you will delete the Licensed Materials. Sections 2-7 of this 80 | Agreement survive any termination of this Agreement. LinkedIn may discontinue 81 | the availability of some or all of the Licensed Materials at any time for any 82 | reason. 83 | 84 | 7. Miscellaneous. This Agreement will be governed by and construed in 85 | accordance with the laws of the State of California without regard to conflict 86 | of laws principles. The exclusive forum for any disputes arising out of or 87 | relating to this Agreement shall be an appropriate federal or state court 88 | sitting in the County of Santa Clara, State of California. If LinkedIn does 89 | not act to enforce a breach of this Agreement, that does not mean that 90 | LinkedIn has waived its right to enforce this Agreement. The Agreement does 91 | not create a partnership, agency relationship, or joint venture between the 92 | parties. Neither party has the power or authority to bind the other or to 93 | create any obligation or responsibility on behalf of the other. You may not, 94 | without LinkedIn’s prior written consent, assign or delegate any rights or 95 | obligations under these terms, including in connection with a change of 96 | control. Any purported assignment and delegation shall be ineffective. The 97 | Agreement shall bind and inure to the benefit of the parties, their respective 98 | successors and permitted assigns. If any provision of the Agreement is 99 | unenforceable, that provision will be modified to render it enforceable to the 100 | extent possible to give effect to the parties’ intentions and the remaining 101 | provisions will not be affected. This Agreement is the only agreement between 102 | you and LinkedIn regarding the Licensed Materials, and supersedes all prior 103 | agreements relating to the Licensed Materials. 104 | 105 | Last Updated: March 2019 106 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2023 LinkedIn Corporation 2 | All Rights Reserved. 3 | 4 | Licensed under the LinkedIn Learning Exercise File License (the "License"). 5 | See LICENSE in the project root for license information. 6 | 7 | ATTRIBUTIONS: 8 | 9 | Terraform 10 | https://github.com/hashicorp/terraform 11 | Mozilla Public License 2.0 12 | https://www.mozilla.org/en-US/MPL/2.0/ 13 | 14 | Please note, this project may automatically load third party code from external 15 | repositories (for example, NPM modules, Composer packages, or other dependencies). 16 | If so, such third party code may be subject to other license terms than as set 17 | forth above. In addition, such third party code may also depend on and load 18 | multiple tiers of dependencies. Please review the applicable licenses of the 19 | additional dependencies. 20 | 21 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 22 | 23 | Mozilla Public License, version 2.0 24 | 25 | 1. Definitions 26 | 27 | 1.1. “Contributor” 28 | 29 | means each individual or legal entity that creates, contributes to the 30 | creation of, or owns Covered Software. 31 | 32 | 1.2. “Contributor Version” 33 | 34 | means the combination of the Contributions of others (if any) used by a 35 | Contributor and that particular Contributor’s Contribution. 36 | 37 | 1.3. “Contribution” 38 | 39 | means Covered Software of a particular Contributor. 40 | 41 | 1.4. “Covered Software” 42 | 43 | means Source Code Form to which the initial Contributor has attached the 44 | notice in Exhibit A, the Executable Form of such Source Code Form, and 45 | Modifications of such Source Code Form, in each case including portions 46 | thereof. 47 | 48 | 1.5. “Incompatible With Secondary Licenses” 49 | means 50 | 51 | a. that the initial Contributor has attached the notice described in 52 | Exhibit B to the Covered Software; or 53 | 54 | b. that the Covered Software was made available under the terms of version 55 | 1.1 or earlier of the License, but not also under the terms of a 56 | Secondary License. 57 | 58 | 1.6. “Executable Form” 59 | 60 | means any form of the work other than Source Code Form. 61 | 62 | 1.7. “Larger Work” 63 | 64 | means a work that combines Covered Software with other material, in a separate 65 | file or files, that is not Covered Software. 66 | 67 | 1.8. “License” 68 | 69 | means this document. 70 | 71 | 1.9. “Licensable” 72 | 73 | means having the right to grant, to the maximum extent possible, whether at the 74 | time of the initial grant or subsequently, any and all of the rights conveyed by 75 | this License. 76 | 77 | 1.10. “Modifications” 78 | 79 | means any of the following: 80 | 81 | a. any file in Source Code Form that results from an addition to, deletion 82 | from, or modification of the contents of Covered Software; or 83 | 84 | b. any new file in Source Code Form that contains any Covered Software. 85 | 86 | 1.11. “Patent Claims” of a Contributor 87 | 88 | means any patent claim(s), including without limitation, method, process, 89 | and apparatus claims, in any patent Licensable by such Contributor that 90 | would be infringed, but for the grant of the License, by the making, 91 | using, selling, offering for sale, having made, import, or transfer of 92 | either its Contributions or its Contributor Version. 93 | 94 | 1.12. “Secondary License” 95 | 96 | means either the GNU General Public License, Version 2.0, the GNU Lesser 97 | General Public License, Version 2.1, the GNU Affero General Public 98 | License, Version 3.0, or any later versions of those licenses. 99 | 100 | 1.13. “Source Code Form” 101 | 102 | means the form of the work preferred for making modifications. 103 | 104 | 1.14. “You” (or “Your”) 105 | 106 | means an individual or a legal entity exercising rights under this 107 | License. For legal entities, “You” includes any entity that controls, is 108 | controlled by, or is under common control with You. For purposes of this 109 | definition, “control” means (a) the power, direct or indirect, to cause 110 | the direction or management of such entity, whether by contract or 111 | otherwise, or (b) ownership of more than fifty percent (50%) of the 112 | outstanding shares or beneficial ownership of such entity. 113 | 114 | 115 | 2. License Grants and Conditions 116 | 117 | 2.1. Grants 118 | 119 | Each Contributor hereby grants You a world-wide, royalty-free, 120 | non-exclusive license: 121 | 122 | a. under intellectual property rights (other than patent or trademark) 123 | Licensable by such Contributor to use, reproduce, make available, 124 | modify, display, perform, distribute, and otherwise exploit its 125 | Contributions, either on an unmodified basis, with Modifications, or as 126 | part of a Larger Work; and 127 | 128 | b. under Patent Claims of such Contributor to make, use, sell, offer for 129 | sale, have made, import, and otherwise transfer either its Contributions 130 | or its Contributor Version. 131 | 132 | 2.2. Effective Date 133 | 134 | The licenses granted in Section 2.1 with respect to any Contribution become 135 | effective for each Contribution on the date the Contributor first distributes 136 | such Contribution. 137 | 138 | 2.3. Limitations on Grant Scope 139 | 140 | The licenses granted in this Section 2 are the only rights granted under this 141 | License. No additional rights or licenses will be implied from the distribution 142 | or licensing of Covered Software under this License. Notwithstanding Section 143 | 2.1(b) above, no patent license is granted by a Contributor: 144 | 145 | a. for any code that a Contributor has removed from Covered Software; or 146 | 147 | b. for infringements caused by: (i) Your and any other third party’s 148 | modifications of Covered Software, or (ii) the combination of its 149 | Contributions with other software (except as part of its Contributor 150 | Version); or 151 | 152 | c. under Patent Claims infringed by Covered Software in the absence of its 153 | Contributions. 154 | 155 | This License does not grant any rights in the trademarks, service marks, or 156 | logos of any Contributor (except as may be necessary to comply with the 157 | notice requirements in Section 3.4). 158 | 159 | 2.4. Subsequent Licenses 160 | 161 | No Contributor makes additional grants as a result of Your choice to 162 | distribute the Covered Software under a subsequent version of this License 163 | (see Section 10.2) or under the terms of a Secondary License (if permitted 164 | under the terms of Section 3.3). 165 | 166 | 2.5. Representation 167 | 168 | Each Contributor represents that the Contributor believes its Contributions 169 | are its original creation(s) or it has sufficient rights to grant the 170 | rights to its Contributions conveyed by this License. 171 | 172 | 2.6. Fair Use 173 | 174 | This License is not intended to limit any rights You have under applicable 175 | copyright doctrines of fair use, fair dealing, or other equivalents. 176 | 177 | 2.7. Conditions 178 | 179 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in 180 | Section 2.1. 181 | 182 | 183 | 3. Responsibilities 184 | 185 | 3.1. Distribution of Source Form 186 | 187 | All distribution of Covered Software in Source Code Form, including any 188 | Modifications that You create or to which You contribute, must be under the 189 | terms of this License. You must inform recipients that the Source Code Form 190 | of the Covered Software is governed by the terms of this License, and how 191 | they can obtain a copy of this License. You may not attempt to alter or 192 | restrict the recipients’ rights in the Source Code Form. 193 | 194 | 3.2. Distribution of Executable Form 195 | 196 | If You distribute Covered Software in Executable Form then: 197 | 198 | a. such Covered Software must also be made available in Source Code Form, 199 | as described in Section 3.1, and You must inform recipients of the 200 | Executable Form how they can obtain a copy of such Source Code Form by 201 | reasonable means in a timely manner, at a charge no more than the cost 202 | of distribution to the recipient; and 203 | 204 | b. You may distribute such Executable Form under the terms of this License, 205 | or sublicense it under different terms, provided that the license for 206 | the Executable Form does not attempt to limit or alter the recipients’ 207 | rights in the Source Code Form under this License. 208 | 209 | 3.3. Distribution of a Larger Work 210 | 211 | You may create and distribute a Larger Work under terms of Your choice, 212 | provided that You also comply with the requirements of this License for the 213 | Covered Software. If the Larger Work is a combination of Covered Software 214 | with a work governed by one or more Secondary Licenses, and the Covered 215 | Software is not Incompatible With Secondary Licenses, this License permits 216 | You to additionally distribute such Covered Software under the terms of 217 | such Secondary License(s), so that the recipient of the Larger Work may, at 218 | their option, further distribute the Covered Software under the terms of 219 | either this License or such Secondary License(s). 220 | 221 | 3.4. Notices 222 | 223 | You may not remove or alter the substance of any license notices (including 224 | copyright notices, patent notices, disclaimers of warranty, or limitations 225 | of liability) contained within the Source Code Form of the Covered 226 | Software, except that You may alter any license notices to the extent 227 | required to remedy known factual inaccuracies. 228 | 229 | 3.5. Application of Additional Terms 230 | 231 | You may choose to offer, and to charge a fee for, warranty, support, 232 | indemnity or liability obligations to one or more recipients of Covered 233 | Software. However, You may do so only on Your own behalf, and not on behalf 234 | of any Contributor. You must make it absolutely clear that any such 235 | warranty, support, indemnity, or liability obligation is offered by You 236 | alone, and You hereby agree to indemnify every Contributor for any 237 | liability incurred by such Contributor as a result of warranty, support, 238 | indemnity or liability terms You offer. You may include additional 239 | disclaimers of warranty and limitations of liability specific to any 240 | jurisdiction. 241 | 242 | 4. Inability to Comply Due to Statute or Regulation 243 | 244 | If it is impossible for You to comply with any of the terms of this License 245 | with respect to some or all of the Covered Software due to statute, judicial 246 | order, or regulation then You must: (a) comply with the terms of this License 247 | to the maximum extent possible; and (b) describe the limitations and the code 248 | they affect. Such description must be placed in a text file included with all 249 | distributions of the Covered Software under this License. Except to the 250 | extent prohibited by statute or regulation, such description must be 251 | sufficiently detailed for a recipient of ordinary skill to be able to 252 | understand it. 253 | 254 | 5. Termination 255 | 256 | 5.1. The rights granted under this License will terminate automatically if You 257 | fail to comply with any of its terms. However, if You become compliant, 258 | then the rights granted under this License from a particular Contributor 259 | are reinstated (a) provisionally, unless and until such Contributor 260 | explicitly and finally terminates Your grants, and (b) on an ongoing basis, 261 | if such Contributor fails to notify You of the non-compliance by some 262 | reasonable means prior to 60 days after You have come back into compliance. 263 | Moreover, Your grants from a particular Contributor are reinstated on an 264 | ongoing basis if such Contributor notifies You of the non-compliance by 265 | some reasonable means, this is the first time You have received notice of 266 | non-compliance with this License from such Contributor, and You become 267 | compliant prior to 30 days after Your receipt of the notice. 268 | 269 | 5.2. If You initiate litigation against any entity by asserting a patent 270 | infringement claim (excluding declaratory judgment actions, counter-claims, 271 | and cross-claims) alleging that a Contributor Version directly or 272 | indirectly infringes any patent, then the rights granted to You by any and 273 | all Contributors for the Covered Software under Section 2.1 of this License 274 | shall terminate. 275 | 276 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user 277 | license agreements (excluding distributors and resellers) which have been 278 | validly granted by You or Your distributors under this License prior to 279 | termination shall survive termination. 280 | 281 | 6. Disclaimer of Warranty 282 | 283 | Covered Software is provided under this License on an “as is” basis, without 284 | warranty of any kind, either expressed, implied, or statutory, including, 285 | without limitation, warranties that the Covered Software is free of defects, 286 | merchantable, fit for a particular purpose or non-infringing. The entire 287 | risk as to the quality and performance of the Covered Software is with You. 288 | Should any Covered Software prove defective in any respect, You (not any 289 | Contributor) assume the cost of any necessary servicing, repair, or 290 | correction. This disclaimer of warranty constitutes an essential part of this 291 | License. No use of any Covered Software is authorized under this License 292 | except under this disclaimer. 293 | 294 | 7. Limitation of Liability 295 | 296 | Under no circumstances and under no legal theory, whether tort (including 297 | negligence), contract, or otherwise, shall any Contributor, or anyone who 298 | distributes Covered Software as permitted above, be liable to You for any 299 | direct, indirect, special, incidental, or consequential damages of any 300 | character including, without limitation, damages for lost profits, loss of 301 | goodwill, work stoppage, computer failure or malfunction, or any and all 302 | other commercial damages or losses, even if such party shall have been 303 | informed of the possibility of such damages. This limitation of liability 304 | shall not apply to liability for death or personal injury resulting from such 305 | party’s negligence to the extent applicable law prohibits such limitation. 306 | Some jurisdictions do not allow the exclusion or limitation of incidental or 307 | consequential damages, so this exclusion and limitation may not apply to You. 308 | 309 | 8. Litigation 310 | 311 | Any litigation relating to this License may be brought only in the courts of 312 | a jurisdiction where the defendant maintains its principal place of business 313 | and such litigation shall be governed by laws of that jurisdiction, without 314 | reference to its conflict-of-law provisions. Nothing in this Section shall 315 | prevent a party’s ability to bring cross-claims or counter-claims. 316 | 317 | 9. Miscellaneous 318 | 319 | This License represents the complete agreement concerning the subject matter 320 | hereof. If any provision of this License is held to be unenforceable, such 321 | provision shall be reformed only to the extent necessary to make it 322 | enforceable. Any law or regulation which provides that the language of a 323 | contract shall be construed against the drafter shall not be used to construe 324 | this License against a Contributor. 325 | 326 | 327 | 10. Versions of the License 328 | 329 | 10.1. New Versions 330 | 331 | Mozilla Foundation is the license steward. Except as provided in Section 332 | 10.3, no one other than the license steward has the right to modify or 333 | publish new versions of this License. Each version will be given a 334 | distinguishing version number. 335 | 336 | 10.2. Effect of New Versions 337 | 338 | You may distribute the Covered Software under the terms of the version of 339 | the License under which You originally received the Covered Software, or 340 | under the terms of any subsequent version published by the license 341 | steward. 342 | 343 | 10.3. Modified Versions 344 | 345 | If you create software not governed by this License, and you want to 346 | create a new license for such software, you may create and use a modified 347 | version of this License if you rename the license and remove any 348 | references to the name of the license steward (except to note that such 349 | modified license differs from this License). 350 | 351 | 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses 352 | If You choose to distribute Source Code Form that is Incompatible With 353 | Secondary Licenses under the terms of this version of the License, the 354 | notice described in Exhibit B of this License must be attached. 355 | 356 | Exhibit A - Source Code Form License Notice 357 | 358 | This Source Code Form is subject to the 359 | terms of the Mozilla Public License, v. 360 | 2.0. If a copy of the MPL was not 361 | distributed with this file, You can 362 | obtain one at 363 | http://mozilla.org/MPL/2.0/. 364 | 365 | If it is not possible or desirable to put the notice in a particular file, then 366 | You may include the notice in a location (such as a LICENSE file in a relevant 367 | directory) where a recipient would be likely to look for such a notice. 368 | 369 | You may add additional accurate notices of copyright ownership. 370 | 371 | Exhibit B - “Incompatible With Secondary Licenses” Notice 372 | 373 | This Source Code Form is “Incompatible 374 | With Secondary Licenses”, as defined by 375 | the Mozilla Public License, v. 2.0. 376 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Advanced Terraform 2 | This is the repository for the LinkedIn Learning course Advanced Terraform. The full course is available from [LinkedIn Learning][lil-course-url]. 3 | 4 | ![Advanced Terraform][lil-thumbnail-url] 5 | 6 | Terraform simplifies and accelerates the configuration and deployment of infrastructure, including cloud-based environments. In this project-based course, David Swersky highlights a series of advanced Terraform use cases. David goes over the steps to create a new Terraform configuration, then explores intermediate concepts like variables, looping, expression and functions, modules, and more. He explains advanced concepts, such as custom modules, defining a remote state backend, and deploying configurations across multiple environments. The course is capped with an example model for a complete Continuous Integration/Continuous Delivery pipeline for deploying Terraform configurations. 7 | 8 | ## Instructions 9 | This repository has branches for each of the videos in the course. You can use the branch pop up menu in github to switch to a specific branch and take a look at the course at that stage, or you can add `/tree/BRANCH_NAME` to the URL to go to the branch you want to access. 10 | 11 | ## Branches 12 | The branches are structured to correspond to the videos in the course. The naming convention is `CHAPTER#_MOVIE#`. As an example, the branch named `02_03` corresponds to the second chapter and the third video in that chapter. 13 | Some branches will have a beginning and an end state. These are marked with the letters `b` for "beginning" and `e` for "end". The `b` branch contains the code as it is at the beginning of the movie. The `e` branch contains the code as it is at the end of the movie. The `main` branch holds the final state of the code when in the course. 14 | 15 | When switching from one exercise files branch to the next after making changes to the files, you may get a message like this: 16 | 17 | error: Your local changes to the following files would be overwritten by checkout: [files] 18 | Please commit your changes or stash them before you switch branches. 19 | Aborting 20 | 21 | To resolve this issue: 22 | 23 | Add changes to git using this command: git add . 24 | Commit changes using this command: git commit -m "some message" 25 | 26 | 27 | ### Instructor 28 | 29 | David Swersky 30 | 31 | DevOps and enterprise architect 32 | 33 | 34 | 35 | Check out my other courses on [LinkedIn Learning](https://www.linkedin.com/learning/instructors/david-swersky). 36 | 37 | [lil-course-url]: https://www.linkedin.com/learning/advanced-terraform-18720794?dApp=59033956 38 | [lil-thumbnail-url]: https://media.licdn.com/dms/image/C560DAQGfrjsVMJJlFg/learning-public-crop_675_1200/0/1673639139822?e=2147483647&v=beta&t=Po6XcY4t4DcIZ__O-16BY24eHt0MPhPODwJl90L1rs0 39 | -------------------------------------------------------------------------------- /gcp_commands.md: -------------------------------------------------------------------------------- 1 | #GCP Command Reference 2 | ===================== 3 | 4 | These gcloud commands are used throughout the course: 5 | 6 | ## 00_04_Exercise_Files 7 | **Enable APIs:** 8 | gcloud services enable iam.googleapis.com 9 | 10 | gcloud services enable cloudresourcemanager.googleapis.com 11 | 12 | 13 | ## 04_03_Terraform_Cloud_Setup 14 | ``` 15 | gcloud iam service-accounts create terraform-cloud \ 16 | --description="SA for Terraform Cloud operations" \ 17 | --display-name="terraform-cloud" 18 | 19 | gcloud projects add-iam-policy-binding [PROJECT_ID] \ 20 | --member="serviceAccount:terraform-cloud@[PROJECT_ID].iam.gserviceaccount.com" \ 21 | --role="roles/owner" 22 | 23 | gcloud iam service-accounts keys create tf_sa_key \ 24 | --iam-account=terraform-cloud@[PROJECT_ID].iam.gserviceaccount.com 25 | ``` -------------------------------------------------------------------------------- /main.tf: -------------------------------------------------------------------------------- 1 | ### PROVIDER 2 | provider "google" { 3 | project = "advancedterraform" #replace this with your project-id 4 | region = "us-central1" 5 | zone = "us-central1-a" 6 | } 7 | 8 | ### NETWORK 9 | data "google_compute_network" "default" { 10 | name = "default" 11 | } 12 | 13 | ## SUBNET 14 | resource "google_compute_subnetwork" "subnet-1" { 15 | name = "subnet1" 16 | ip_cidr_range = "10.127.0.0/20" 17 | network = data.google_compute_network.default.self_link 18 | region = "us-central1" 19 | private_ip_google_access = true 20 | } 21 | 22 | resource "google_compute_firewall" "default" { 23 | name = "test-firewall" 24 | network = data.google_compute_network.default.self_link 25 | 26 | allow { 27 | protocol = "icmp" 28 | } 29 | 30 | allow { 31 | protocol = "tcp" 32 | ports = ["80", "8080", "1000-2000", "22"] 33 | } 34 | 35 | source_tags = ["web"] 36 | } 37 | 38 | ### COMPUTE 39 | ## NGINX PROXY 40 | resource "google_compute_instance" "nginx_instance" { 41 | name = "nginx-proxy" 42 | machine_type = "f1-micro" 43 | tags = ["web"] 44 | 45 | boot_disk { 46 | initialize_params { 47 | image = "debian-cloud/debian-11" 48 | } 49 | } 50 | 51 | network_interface { 52 | network = data.google_compute_network.default.self_link 53 | subnetwork = google_compute_subnetwork.subnet-1.self_link 54 | access_config { 55 | 56 | } 57 | } 58 | } 59 | 60 | ## WEB1 61 | resource "google_compute_instance" "web1" { 62 | name = "web1" 63 | machine_type = "f1-micro" 64 | 65 | boot_disk { 66 | initialize_params { 67 | image = "debian-cloud/debian-11" 68 | } 69 | } 70 | 71 | network_interface { 72 | # A default network is created for all GCP projects 73 | network = data.google_compute_network.default.self_link 74 | subnetwork = google_compute_subnetwork.subnet-1.self_link 75 | } 76 | } 77 | ## WEB2 78 | resource "google_compute_instance" "web2" { 79 | name = "web2" 80 | machine_type = "f1-micro" 81 | 82 | boot_disk { 83 | initialize_params { 84 | image = "debian-cloud/debian-11" 85 | } 86 | } 87 | 88 | network_interface { 89 | network = data.google_compute_network.default.self_link 90 | subnetwork = google_compute_subnetwork.subnet-1.self_link 91 | } 92 | } 93 | ## WEB3 94 | resource "google_compute_instance" "web3" { 95 | name = "web3" 96 | machine_type = "f1-micro" 97 | 98 | boot_disk { 99 | initialize_params { 100 | image = "debian-cloud/debian-11" 101 | } 102 | } 103 | 104 | network_interface { 105 | network = data.google_compute_network.default.self_link 106 | subnetwork = google_compute_subnetwork.subnet-1.self_link 107 | } 108 | } 109 | 110 | ## DB 111 | resource "google_compute_instance" "mysqldb" { 112 | name = "mysqldb" 113 | machine_type = "f1-micro" 114 | 115 | boot_disk { 116 | initialize_params { 117 | image = "debian-cloud/debian-11" 118 | } 119 | } 120 | 121 | network_interface { 122 | network = data.google_compute_network.default.self_link 123 | subnetwork = google_compute_subnetwork.subnet-1.self_link 124 | } 125 | } --------------------------------------------------------------------------------