Skip to content

Commit a0a3d06

Browse files
committed
Reorganize Repo
1 parent dafadba commit a0a3d06

15 files changed

+397
-2
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
indent_style = space
9+
indent_size = 2

.github/ISSUE_TEMPLATE/bug_report.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Bug report
3+
about: Create a bug report to help us improve.
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior including the relevant Terraform version number and any code snippets and module inputs you used.
15+
16+
```hcl
17+
// paste code snippets here
18+
```
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Nice to have**
24+
- [ ] Terminal output
25+
- [ ] Screenshots
26+
- [ ] OS and Terraform versions
27+
28+
**Additional context**
29+
Add any other context about the problem here.
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Feature request
3+
about: Submit a feature request for this repo.
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
## Describe the solution you'd like
11+
12+
<!-- A clear and concise description of what you want to happen and the expected benefits. -->
13+
14+
## Describe alternatives you've considered
15+
16+
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
17+
18+
## Additional context
19+
20+
<!-- Add any other context or screenshots about the feature request here. -->
21+
22+
## Checklist
23+
- [ ] I have checked if a similar feature request already exists.
24+
- [ ] I believe this feature would be beneficial to a wider audience and aligns with the project's goals.
25+
- [ ] I have considered potential downsides or challenges of implementing this feature.

.github/pull_request_template.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Description
2+
3+
<!-- Please, provide a brief description of the changes you've made in this pull request. -->
4+
5+
## Related Issues
6+
7+
<!-- Links to related issues, fixed issues or partially addressed by this PR. -->
8+
9+
## Changes
10+
11+
<!-- List the main changes or features introduced by this PR -->
12+
13+
## Screenshots (if applicable)
14+
15+
<!-- Add any relevant screenshots or GIFs to showcase the changes visually -->
16+
17+
## Checklist
18+
19+
- [ ] I have tested these changes thoroughly.
20+
- [ ] My code follows the project's coding style.
21+
- [ ] I have added appropriate comments to my code, especially in complex areas.
22+
- [ ] All new and existing tests passed locally.

.github/workflows/ci.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
analyze:
11+
name: Analyze the Terraform scripts
12+
runs-on: ubuntu-22.04
13+
timeout-minutes: 5
14+
permissions:
15+
actions: read
16+
contents: read
17+
security-events: write
18+
steps:
19+
- id: clone_repository
20+
name: Clone repository
21+
# actions/checkout@v4.1.1
22+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
23+
24+
- id: setup_terraform
25+
name: Setup Terraform CLI
26+
# hashicorp/setup-terraform@v3.0.0
27+
uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36
28+
29+
- id: run_terraform_init
30+
name: Run Terraform init
31+
run: terraform init
32+
33+
- id: run_terraform_fmt
34+
name: Run Terraform format check
35+
run: terraform fmt -check -recursive
36+
37+
- id: run_terraform_validate
38+
name: Run Terraform validate check
39+
run: terraform validate
40+
41+
- id: run_trivy_config
42+
name: Run Trivy vulnerability scanner
43+
# aquasecurity/trivy-action@v0.16.0
44+
uses: aquasecurity/trivy-action@91713af97dc80187565512baba96e4364e983601
45+
with:
46+
scan-type: config
47+
trivy-config: trivy.yaml
48+
hide-progress: false
49+
format: sarif
50+
output: trivy.sarif
51+
52+
- id: run_sarif_upload
53+
name: Upload Trivy SARIF results
54+
# github/codeql-action/upload-sarif@v2.22.9
55+
uses: github/codeql-action/upload-sarif@382a50a0284c0de445104889a9d6003acb4b3c1d
56+
timeout-minutes: 1
57+
with:
58+
sarif_file: trivy.sarif

.github/workflows/docs.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "Continuous Integration: Terraform Docs"
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
docs:
8+
name: Generate Terraform documentation
9+
runs-on: ubuntu-22.04
10+
timeout-minutes: 1
11+
steps:
12+
- id: clone_repository
13+
name: Clone repository
14+
# actions/checkout@v4.1.1
15+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
16+
with:
17+
ref: ${{ github.event.pull_request.head.ref }}
18+
19+
- id: run_terraform_docs
20+
name: Render terraform docs and push changes back to PR
21+
# terraform-docs/gh-actions@1.0.0
22+
uses: terraform-docs/gh-actions@f6d59f89a280fa0a3febf55ef68f146784b20ba0
23+
with:
24+
working-dir: .
25+
output-file: README.md
26+
config-file: terraform-docs.yml
27+
output-method: inject
28+
git-push: "true"
29+
git-commit-message: "terraform-docs: updated markdown table"

.trivyignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
AVD-GCP-0027
2+
AVD-GCP-0031
3+

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.1.0
2+
3+
* Initial version for GraphDB GCP module

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@Ontotext-AD/tes

CONTRIBUTING.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Contributing to GraphDB GCP Terraform Module
2+
3+
Here are a few guidelines to help you get started.
4+
5+
## Getting Started
6+
7+
1. Fork this repository.
8+
2. Clone your forked repository to your local machine.
9+
3. Create a new branch for your changes: `git checkout -b feature/my-new-feature`.
10+
4. Make your changes and test them thoroughly.
11+
5. Commit your changes: `git commit -m "Add some feature"`.
12+
6. Push your changes to your fork: `git push origin feature/my-new-feature`.
13+
7. Create a pull request from your branch to the main repository's `main` branch.
14+
15+
## Code Style
16+
17+
Make sure your code follows our and Terraform coding styles.
18+
19+
## Tests
20+
21+
If applicable, add or update tests to ensure your changes work as intended.
22+
23+
## Documentation
24+
25+
If your changes introduce new features, update the documentation to reflect those changes.
26+
27+
## Commit Message Guidelines
28+
29+
Please use meaningful commit messages. Follow the format:
30+
31+
```
32+
[Type] Short description
33+
34+
Longer description of the changes, especially whys.
35+
```
36+
37+
Types: `[Feature]`, `[Fix]`, `[Docs]`, `[Refactor]`, `[Chore]`, `[Style]`
38+
39+
## Pull Request Checklist
40+
41+
- [ ] I have tested these changes thoroughly.
42+
- [ ] My code follows the project's coding style.
43+
- [ ] I have added appropriate comments to my code, especially in complex areas.
44+
- [ ] All new and existing tests passed locally.
45+
46+
## Feedback
47+
48+
Feedback and suggestions are welcome! Feel free to open an issue if you have any questions or ideas.

README.md

+118
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,89 @@
11
# GraphDB deployment package on GCP
22

3+
This terraform module allows you to deploy GraphDB instance in Google Compute Engine.
4+
5+
## Table of contents
6+
7+
- [About GraphDB](#about-graphdb)
8+
- [Features](#features)
9+
- [Versioning](#versioning)
10+
- [Prerequisites](#prerequisites)
11+
- [Inputs](#inputs)
12+
- [Quick Start](#quickstart)
13+
- [Metadata](#metadata)
14+
- [Resources](#resources)
15+
- [Local Development](#local-development)
16+
- [Release History](#release-history)
17+
- [Contributing](#contributing)
18+
- [License](#license)
19+
20+
## About GraphDB
21+
22+
<p align="center">
23+
<a href="https://www.ontotext.com/products/graphdb/">
24+
<picture>
25+
<img src="https://www.ontotext.com/wp-content/uploads/2022/09/Logo-GraphDB.svg" alt="GraphDB logo" title="GraphDB"
26+
height="75">
27+
</picture>
28+
</a>
29+
</p>
30+
31+
Ontotext GraphDB is a highly efficient, scalable and robust graph database with RDF and SPARQL support. With excellent
32+
enterprise features,
33+
integration with external search applications, compatibility with industry standards, and both community and commercial
34+
support, GraphDB is the
35+
preferred database choice of both small independent developers and big enterprises.
36+
37+
## Features
38+
39+
The module provides the building blocks of configuring, deploying and provisioning a single VM of GraphDB
40+
using Google Compute Engine. Key features of the module include:
41+
42+
- Google Cloud Compute Engine Instance
43+
44+
## Versioning
45+
46+
The Terraform module follows the Semantic Versioning 2.0.0 rules and has a release lifecycle separate from the GraphDB
47+
versions. The next table shows the version compatability between GraphDB, and the Terraform module.
48+
49+
| GraphDB Terraform | GraphDB |
50+
|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
51+
| [Version 0.0.1](https://github.com/Ontotext-AD/terraform-gcp-graphdb/releases) | [Version 10.7.x](https://graphdb.ontotext.com/documentation/10.7/release-notes.html) |
52+
53+
You can track the particular version updates of GraphDB in the [changelog](CHANGELOG.md).
54+
55+
## Prerequisites
56+
57+
Before you begin using this Terraform module, ensure you meet the following prerequisites:
58+
59+
- **Google Cloud CLI**:
60+
[Google Cloud CLI](https://cloud.google.com/sdk/docs/install)
61+
62+
- **Terraform Installed**: You should have Terraform installed on your local machine. You can download Terraform from
63+
the [https://developer.hashicorp.com/terraform/install?product_intent=terraform](Terraform website).
64+
65+
- **Google Cloud Credentials**: Ensure that you have Google Cloud credentials configured on your machine. You can configure Google Cloud access
66+
keys and secret keys using the [Google Cloud CLI](https://cloud.google.com/docs/authentication/gcloud).
67+
68+
- **Terraform Google Cloud Provider Configuration**: Configure the Google Cloud provider in your Terraform project. You can add your Google Cloud
69+
access and secret keys as environment variables or use other methods for provider configuration.
70+
71+
<!-- BEGIN_TF_DOCS -->
72+
## Inputs
73+
74+
| Name | Description | Type | Default | Required |
75+
|------|-------------|------|---------|:--------:|
76+
| source\_image | Defines the VM image passed from the GCP Marketplace | `string` | `"projects/graphdb-public/global/images/ontotext-graphdb-10-7-3-202409031355"` | no |
77+
| goog\_cm\_deployment\_name | Deployment name | `string` | `"graphdb"` | no |
78+
| project\_id | Project in which the VM will be created | `string` | n/a | yes |
79+
| zone | The zone where the VM will be created | `string` | `"us-central1-a"` | no |
80+
| machine\_type | Type of the VM that will be created | `string` | `"n2-highmem-8"` | no |
81+
| boot\_disk\_size | Boot disk size in GBs | `number` | `500` | no |
82+
| boot\_disk\_type | Type of the boot disk | `string` | `"pd-ssd"` | no |
83+
| network\_interface | The network interface to attach the VM to | `string` | `"default"` | no |
84+
| allowed\_ingress\_cidrs | CIDR blocks that are allowed to access the GraphDB port | `list(string)` | ```[ "0.0.0.0/0" ]``` | no |
85+
<!-- END_TF_DOCS -->
86+
387
## Quickstart
488

589
```shell
@@ -33,3 +117,37 @@ cft blueprint metadata -v -p .
33117
- https://github.com/GoogleCloudPlatform/marketplace-tools/blob/master/examples/terraform/wordpress/metadata.display.yaml
34118
- https://github.com/g-awmalik/terraform-google-canonical-mp/blob/main/metadata.display.yaml
35119
- Blueprint reference https://pkg.go.dev/github.com/GoogleCloudPlatform/cloud-foundation-toolkit/cli/bpmetadata
120+
121+
## Local Development
122+
123+
Instead of using the module dependency, you can create a local variables file named `terraform.tfvars` and provide
124+
configuration overrides there.
125+
Here's an example of a `terraform.tfvars` file:
126+
127+
```hcl
128+
129+
project_id = "example-project-id"
130+
131+
zone = "us-central1-a"
132+
133+
machine_type = "n2-highmem-8"
134+
135+
boot_disk_size = "500"
136+
137+
boot_disk_type = "pd-ssd"
138+
139+
allowed_ingress_cidrs = ["0.0.0.0/0"]
140+
141+
```
142+
143+
## Release History
144+
145+
All notable changes between version are tracked and documented at [CHANGELOG.md](CHANGELOG.md).
146+
147+
## Contributing
148+
149+
Check out the contributors guide [CONTRIBUTING.md](CONTRIBUTING.md).
150+
151+
## License
152+
153+
This code is released under the Apache 2.0 License. See [LICENSE](LICENSE) for more details.

main.tf

+13-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ resource "google_compute_instance" "graphdb" {
1212
# The boot disk must be set to the variable declared in Producer Portal
1313
image = var.source_image
1414
size = var.boot_disk_size
15-
type = var.boot_disk_type
15+
type = var.boot_disk_type
1616
}
1717
}
1818

@@ -24,6 +24,18 @@ resource "google_compute_instance" "graphdb" {
2424
}
2525
}
2626

27+
# Block the usage of project-level SSH keys
28+
metadata = {
29+
block-project-ssh-keys = true
30+
}
31+
32+
# Enable VTPM module
33+
shielded_instance_config {
34+
enable_secure_boot = true
35+
enable_vtpm = true
36+
enable_integrity_monitoring = true
37+
}
38+
2739
tags = [var.goog_cm_deployment_name]
2840
}
2941

0 commit comments

Comments
 (0)