Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly handle terraform resources #438

Open
Riduidel opened this issue Jul 4, 2024 · 2 comments
Open

Correctly handle terraform resources #438

Riduidel opened this issue Jul 4, 2024 · 2 comments
Labels
effort: 13 priority: 2day state: pending Pending requirements, dependencies, data, or more information. type: discussion Questions, proposals and info that requires discussion. work: complex The situation is complex, emergent practices used.

Comments

@Riduidel
Copy link
Owner

Riduidel commented Jul 4, 2024

Instead of focusing about cloud providers, it may be a better idea to interface with terraform-docs as terraform looks like a common ground for all DevOps/cloud native deployments.

@Riduidel Riduidel added state: pending Pending requirements, dependencies, data, or more information. effort: 8 type: discussion Questions, proposals and info that requires discussion. priority: 2day work: complex The situation is complex, emergent practices used. labels Jul 4, 2024
@Riduidel
Copy link
Owner Author

Riduidel commented Jul 4, 2024

A first integration has been attempted by simply calling terraform-docs through Docker and including the generated asciidoc file.

Docker call is done the following way

			<plugin>
				<groupId>io.fabric8</groupId>
				<artifactId>docker-maven-plugin</artifactId>
				<version>0.44.0</version>
				<executions>
					<execution>
						<id>Generate terraform docs</id>
						<phase>process-resources</phase>
						<goals>
							<goal>start</goal>
						</goals>
						<configuration>
							<containerNamePattern>terraform-docs</containerNamePattern>
							<images>
								<image>
									<name>
										quay.io/terraform-docs/terraform-docs:0.18.0</name>
									<run>
										<autoRemove>true</autoRemove>
										<cmd>
											<arg>asciidoc</arg>
											<arg>document</arg>
											<arg>/terraform-source</arg>
											<arg>--output-file</arg>
											<arg><![CDATA[/terraform-doc/documentation.adoc]]></arg>
										</cmd>
										<volumes>
											<bind>
												<volume><![CDATA[${terraform.module}:/terraform-source]]></volume>
												<volume><![CDATA[${terraform.doc}:/terraform-doc]]></volume>
											</bind>
										</volumes>
									</run>
								</image>
							</images>
							<showLogs>true</showLogs>
						</configuration>
					</execution>
				</executions>
			</plugin>

Unfortunatly, the generated document is hardly readable :

  • It contains a list of providers with no explanation about their usage
  • It contains a list of resources which can, sometimes, be mapped upon our architectural elements, but for which there is strictly no explanation
  • It contains a list of inputs, which must in fact be deployment secrets, but which usage is not explained.

In fact, with our current terraform sample (which may not have been optimized for documentation), it's quite useless. Furthermore, no link is made between these deployment objects and the architecture elements exposed in the "abstract" architecture.

@Riduidel
Copy link
Owner Author

Riduidel commented Jul 4, 2024

As a consequence, a good solution be to load all Terrraform objects as Java code, then augment the architecture description with these elements, and produce diagrams exposing elements of the right complexity level.

@Riduidel Riduidel changed the title Correctly handle terraform-docs Correctly handle terraform resources Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: 13 priority: 2day state: pending Pending requirements, dependencies, data, or more information. type: discussion Questions, proposals and info that requires discussion. work: complex The situation is complex, emergent practices used.
Projects
None yet
Development

No branches or pull requests

1 participant