Skip to content

Commit

Permalink
Merge c7b4180 into d1907d6
Browse files Browse the repository at this point in the history
  • Loading branch information
Clayton7510 committed Jul 13, 2020
2 parents d1907d6 + c7b4180 commit 7083a16
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 16 deletions.
39 changes: 30 additions & 9 deletions README.md
@@ -1,11 +1,11 @@
[tf-maven-plugin]:https://search.maven.org/artifact/com.deliveredtechnologies/tf-maven-plugin/0.9.1/maven-plugin
[tf-cmd-api]:https://search.maven.org/artifact/com.deliveredtechnologies/tf-cmd-api/0.9.1/jar
[tf-s3-archetype]:https://search.maven.org/artifact/com.deliveredtechnologies/tf-s3-archetype/0.9.1/jar
[tf-maven-plugin]:https://search.maven.org/artifact/com.deliveredtechnologies/tf-maven-plugin/0.10/maven-plugin
[tf-cmd-api]:https://search.maven.org/artifact/com.deliveredtechnologies/tf-cmd-api/0.10/jar
[tf-s3-archetype]:https://search.maven.org/artifact/com.deliveredtechnologies/tf-s3-archetype/0.10/jar
[tf-maven-plugin-snapshot]:https://oss.sonatype.org/content/repositories/snapshots/com/deliveredtechnologies/tf-maven-plugin/
[tf-cmd-api-snapshot]:https://oss.sonatype.org/content/repositories/snapshots/com/deliveredtechnologies/tf-cmd-api/
[tf-s3-archetype-snapshot]:https://oss.sonatype.org/content/repositories/snapshots/com/deliveredtechnologies/tf-s3-archetype/
[maven-badge]:https://img.shields.io/badge/maven%20central-0.9.1-green.svg
[maven-snapshot-badge]:https://img.shields.io/badge/SNAPSHOT-0.10-green.svg
[maven-badge]:https://img.shields.io/badge/maven%20central-0.10-green.svg
[maven-snapshot-badge]:https://img.shields.io/badge/SNAPSHOT-0.11-green.svg

![terraform-maven](.docs/MavenTerraform.png)

Expand Down Expand Up @@ -37,6 +37,7 @@ The Terraform Maven Plugin brings Maven to Terraform, which greatly enhances Ter
* [tf:package](#tfpackage)
* [tf:deploy](#tfdeploy)
* [tf:clean](#tfclean)
* [tf:wrapper](#tfwrapper)
* [How Commands Are Delegated to Terraform](#how-commands-are-delegated-to-terraform)
* [*nix-based Operating Systems](#nix-based-operating-systems)
* [Windows Operating Systems](#windows-operating-systems)
Expand Down Expand Up @@ -251,11 +252,31 @@ Description:

Deletes all 'terraform' files from terraform configurations along with the Terraform modules directory.

| Name | Type | Description |
| ------------ | ------ | ---------------------------------------------------------------------------------------------- |
| Name | Type | Description |
| ------------ | ------- | --------------------------------------------------------------------------------------------- |
| tfRootDir | String | The terraform root module directory location; defaults to src/main/tf/{first directory found} |
| tfModulesDir | String | The directory that contains the Terraform module depenencies; defaults to src/main/.tfmodules |

#### tf:wrapper

Description:

Binds the Maven project to a specific Terraform binary version.

The format of the URL from which to fetch the Terraform binary is modeled after HashiCorp's distribution URL.

```{distributionSite}/{releaseDir}/{releaseVer}/{releaseName}_{releaseVer}_{releaseOS}_{releaseSuffix}```

The default location is

| Name | Type | Description |
| ---------------- | ------ | -------------------------------------------------------------------------------------------------- |
| distributionSite | String | The baseUrl from which to fetch the Terraform binary; defaults to _https://releases.hashicorp.com_ |
| releaseDir | String | The name of the release project; defaults to _terraform_ |
| releaseVer | String | The version of the Terraform binary to bind to the project |
| releaseName | String | The name of the release artifact; defaults to _terraform_ |
| releaseSuffix | String | The suffix of the artifact, including extension; defaults to _amd64.zip_ |

### How Commands Are Delegated to Terraform

Terraform commands are executed in a forked shell that is joined to the Maven process. This has important implications
Expand All @@ -281,15 +302,15 @@ Instead of doing all the above steps you can simply build the module/project by
An example on how to generate the project using an archetype is shown below.

```bash
mvn archetype:generate -B -DarchetypeGroupId=com.deliveredtechnologies -DarchetypeArtifactId="tf-s3-archetype" -DarchetypeVersion=0.8.2 -DgroupId=<custom_group_name> -DartifactId=<custom-artifact_name>
mvn archetype:generate -B -DarchetypeGroupId=com.deliveredtechnologies -DarchetypeArtifactId="tf-s3-archetype" -DarchetypeVersion=0.10 -DgroupId=<custom_group_name> -DartifactId=<custom-artifact_name>
```

Maven Non-Interactive mode creates a project with the name that you passed in <custom_articatId_name> under <custom_groupId_name>.

or

```bash
mvn archetype:generate -DarchetypeGroupId=com.deliveredtechnologies -DarchetypeArtifactId="tf-s3-archetype" -DarchetypeVersion=0.8.2
mvn archetype:generate -DarchetypeGroupId=com.deliveredtechnologies -DarchetypeArtifactId="tf-s3-archetype" -DarchetypeVersion=0.10
```

After running the above command mvn interactive console prompts for the required arguments (ex: groupId and artifactId) and creates the project accordingly.
Expand Down
2 changes: 1 addition & 1 deletion examples/tf-s3-consumer/pom.xml
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
<tf-maven-version>0.10-SNAPSHOT</tf-maven-version>
<tf-maven-version>0.11-SNAPSHOT</tf-maven-version>
</properties>
<artifactId>tf-s3-consumer</artifactId>
<groupId>com.deliveredtechnologies.example.maven.tf</groupId>
Expand Down
2 changes: 1 addition & 1 deletion examples/tf-s3/pom.xml
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
<tf-maven-version>0.10-SNAPSHOT</tf-maven-version>
<tf-maven-version>0.11-SNAPSHOT</tf-maven-version>
</properties>
<artifactId>tf-s3</artifactId>
<groupId>com.deliveredtechnologies.example.maven.tf</groupId>
Expand Down
2 changes: 1 addition & 1 deletion tf-build-tools/pom.xml
Expand Up @@ -6,7 +6,7 @@
<groupId>com.deliveredtechnologies</groupId>
<artifactId>tf-build-tools</artifactId>
<packaging>pom</packaging>
<version>0.10-SNAPSHOT</version>
<version>0.11-SNAPSHOT</version>
<description>Terraform Build Tools: The parent POM project for Java and Terraform Tools</description>
<modules>
<module>tf-cmd-api</module>
Expand Down
2 changes: 1 addition & 1 deletion tf-build-tools/tf-cmd-api/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tf-build-tools</artifactId>
<groupId>com.deliveredtechnologies</groupId>
<version>0.10-SNAPSHOT</version>
<version>0.11-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>tf-cmd-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion tf-build-tools/tf-maven-plugin/pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.deliveredtechnologies</groupId>
<artifactId>tf-build-tools</artifactId>
<version>0.10-SNAPSHOT</version>
<version>0.11-SNAPSHOT</version>
</parent>
<artifactId>tf-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
Expand Down
2 changes: 1 addition & 1 deletion tf-build-tools/tf-s3-archetype/pom.xml
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.deliveredtechnologies</groupId>
<version>0.10-SNAPSHOT</version>
<version>0.11-SNAPSHOT</version>
<artifactId>tf-build-tools</artifactId>
</parent>
<artifactId>tf-s3-archetype</artifactId>
Expand Down
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
<tf-maven-version>0.10-SNAPSHOT</tf-maven-version>
<tf-maven-version>0.11-SNAPSHOT</tf-maven-version>
</properties>
<artifactId>${artifactId}</artifactId>
<groupId>${groupId}</groupId>
Expand Down

0 comments on commit 7083a16

Please sign in to comment.