Skip to content

Commit 70dfd27

Browse files
authored
version 1.0.0 (#18)
* docu for community sdk samples with maven, github package manager removed, thumbnail sample refactored * version set to 0.0.7-beta * links updated * docu added * obs sample * graddle support removed * updated docu for logging * sample for log4j2.xml * BREAKING CHANGE: s3 eventTime changed from String to org.joda.time.DateTime * license info added * MDC migradet to ThreadContext * typos fixed * docu updated * some typos fixed * tests refactored, TestContext improved * bugfix in docs * improved docs * joda-time removed, event timestams as java.time.Instant (BREAKING CHANGE), asyncnotifications added * terraform providers updated to v1.36.45 * JsonAdapter removed, getter for Instant added on some events * version update to 1.0.0 * terraform provider updated to 1.36.47 * beta warnings removed
1 parent 4acda46 commit 70dfd27

File tree

147 files changed

+3976
-1937
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+3976
-1937
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ __pycache__
1616
terraform.tfstate
1717
terraform.tfstate.backup
1818
.tfmodules
19-
19+
dependency-reduced-pom.xml

OpenSourceSoftwareNotice.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## OPEN SOURCE SOFTWARE NOTICE
2+
Please note we provide an open source software notice along with this product. The open source software licenses are granted by the respective right holders. And the open source licenses prevail all other license information with regard to the respective open source software contained in the product, including but not limited to End User Software Licensing Agreement. This notice is provided on behalf of T-Systems International GmbH and any of its local subsidiaries which may have provided this product to you in your local country.
3+
4+
### Warranty Disclaimer
5+
THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
6+
7+

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
OpenTelekomCloud FunctionGraph Java libraries
22
=============================================
33

4-
> [!WARNING]
5-
> ################### BETA Version, subject to change ###################
6-
>
7-
84
This repository provides the FunctionGraph Java Development Guide for running
95
FunctionGraph on [OpenTelekomCloud](https://www.open-telekom-cloud.com/en).
106

doc/source/devguide/deployment/deployment_eventfunctions/deploymentpackage.rst

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ bucket.
8383
Building a deployment package
8484
-----------------------------
8585

86-
Deployment packages can be built using gradle or maven.
86+
Deployment packages can be built using maven.
8787

88-
Following snippets show how to build JAR Package with dependencies using maven or a ZIP package with gradle.
88+
Following snippets show how to build JAR Package with dependencies using maven.
8989

9090
See full code in :github_repo_master:`doc-sample-deploy <sample-doc/doc-sample-deploy>`
9191

@@ -98,14 +98,6 @@ See full code in :github_repo_master:`doc-sample-deploy <sample-doc/doc-sample-d
9898

9999
Generated JAR file can be found in folder ``${PROJECT_ROOT}/target/doc-sample-deploy-jar-with-dependencies.jar``
100100

101-
.. tab:: build.gradle
102-
103-
.. literalinclude:: /../../samples-doc/doc-sample-deploy/build.gradle
104-
:language: Groovy
105-
106-
Generated ZIP file can be found in folder ``${PROJECT_ROOT}/build/distributions/doc-sample-deploy.zip``
107-
108-
109101

110102
Deployment with the FunctionGraph console
111103
-------------------------------------------------------------

doc/source/devguide/deployment/terraform/_index.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ Deploying a function using Terraform
1010
Deploy HTTP Function <terraform_httpfunction>
1111

1212

13-
To use terrform as deployment tool, you should be familiar with
14-
`What is Terrafom <https://developer.hashicorp.com/terraform/intro>`_.
13+
To use Terraform as deployment tool, you should be familiar with
14+
Terraform, see:
15+
`What is Terraform <https://developer.hashicorp.com/terraform/intro>`_.
1516

1617

1718
.. note::
18-
This guide is not indendent to replace Terraform documentation but gives
19+
This guide is not intended to replace Terraform documentation but gives
1920
hints on how to use Terraform on OpenTelekomCloud with FunctionGraph.
2021

doc/source/devguide/deployment/terraform/setuptf.rst

Lines changed: 34 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ For details on how to use Terraform on OpenTelekomCloud, see
1818

1919
Setting Environment Variables
2020
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21-
Set following environment vafiables:
21+
Set following environment variables:
2222

2323
.. list-table:: Environment variables
2424
:widths: 20 20 25
@@ -67,32 +67,17 @@ Set following environment vafiables:
6767
(*) see: `Remote State OBS <https://community.open-telekom-cloud.com/community?id=community_question&sys_id=1207be61138086d0d15a246ea6744162&view_source=searchResult>`_
6868
, `AWS CLI supported environment variables <https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-envvars.html#envvars-list>`_
6969

70+
.. note:: **Simplify Environment variables handling for Terraform**
7071

71-
Simplify Environment variables handling for Terraform
72-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72+
As Terraform can only access environment variables starting with ``TF_VAR_``
73+
you can use follow script to transform ``OTC_*`` variables to
74+
``TF_VAR_OTC_*`` variables:
7375

74-
As Terraform can only access environment variables starting with ``TF_VAR_``
75-
you can use follow script to transform ``OTC_*`` variables to
76-
``TF_VAR_OTC_*`` variables:
76+
.. literalinclude:: /../../samples-doc/doc-sample-deploy-tf/src/main/tf/setupTFvars.sh
77+
:language: shell
78+
:caption: src/main/tf/setupTFvars.sh
7779

78-
.. code-block:: shell
79-
:caption: src/main/tf/setupTFvars.sh
80-
81-
#!/bin/bash
82-
83-
# get all env variables starting with "OTC_" and prepend with "TF_VAR_"
84-
for var in "${!OTC_@}"; do
85-
export $(printf 'TF_VAR_%s=%s\n' "$var" "${!var}")
86-
done
87-
88-
# for provider configuration set AK/SK to be used.
89-
export AWS_ACCESS_KEY_ID=$OTC_SDK_AK
90-
export AWS_SECRET_ACCESS_KEY=$OTC_SDK_SK
91-
92-
# configure terraform s3 backend to work with obs
93-
# https://community.open-telekom-cloud.com/community?id=community_question&sys_id=1207be61138086d0d15a246ea6744162&view_source=searchResult
94-
export AWS_REQUEST_CHECKSUM_CALCULATION=when_required
95-
export AWS_RESPONSE_CHECKSUM_VALIDATION=when_required
80+
You can run this script before running ``terraform init`` to set the environment variables.
9681

9782

9883
Configure ``provider.tf`` file
@@ -106,137 +91,33 @@ Adapt values for:
10691
* ``key`` - this is the path and name in the bucket of the terraform state file
10792
* ``s3`` - configure OBS endpoint according to your tenant
10893

109-
110-
.. code-block::
111-
:caption: /src/main/provider.tf
112-
113-
# ----------------------------------------------------------------------------
114-
# Secret variables to be injected as envvar (capital letters for Windows systems)
115-
# - no defaults
116-
# - Declared as sensitive --> Not printed in console or log if used in resources
117-
# ----------------------------------------------------------------------------
118-
119-
120-
# set by environment variable TF_VAR_OTC_SDK_AK
121-
variable OTC_SDK_AK {
122-
description = "Personal access key"
123-
type = string
124-
sensitive = true
125-
}
126-
127-
# set by environment variable TF_VAR_OTC_SDK_SK
128-
variable OTC_SDK_SK {
129-
description = "Personal secret key"
130-
type = string
131-
sensitive = true
132-
}
133-
134-
# set by environment variable TF_VAR_OTC_SDK_DOMAIN_NAME
135-
variable OTC_SDK_DOMAIN_NAME {
136-
description = "Domain Name, eg. OTC-EU-DE-000000000010000XXXXX"
137-
type = string
138-
}
139-
140-
# set by environment variable TF_VAR_OTC_SDK_PROJECTID
141-
variable OTC_SDK_PROJECTID {
142-
description = "Project Id"
143-
type = string
144-
}
145-
146-
# set by environment variable TF_VAR_OTC_SDK_PROJECTNAME
147-
variable OTC_SDK_PROJECTNAME {
148-
description = "Project Name, eg. eu-de_MYPROJECT"
149-
type = string
150-
}
151-
152-
153-
terraform {
154-
required_providers {
155-
# specifies required provider, source and version
156-
# see https://registry.terraform.io/providers/opentelekomcloud/opentelekomcloud/latest
157-
158-
opentelekomcloud = {
159-
source = "opentelekomcloud/opentelekomcloud"
160-
version = ">= 1.36.42"
161-
}
162-
}
163-
backend "s3" {
164-
# See: https://registry.terraform.io/providers/opentelekomcloud/opentelekomcloud/latest/docs/guides/backends
165-
166-
# (Required) Specifies the endpoint for OpenTelekomCloud OBS.
167-
# The value is https://obs.{{region}}.otc.t-systems.com.
168-
# This can also be sourced from the AWS_S3_ENDPOINT environment variable
169-
endpoints = {
170-
s3 = "https://obs.eu-de.otc.t-systems.com"
171-
}
172-
173-
# (Required) Specifies the bucket name where to store the state.
174-
# Make sure to create it before.
175-
bucket = "sample-tf-backend"
176-
177-
# (Required) Specifies the path to the state file inside the bucket.
178-
key = "terraform_state/sample_statefile.tf"
179-
180-
# (Required) Specifies the region where the bucket is located.
181-
# This can also be sourced from the AWS_DEFAULT_REGION and
182-
# AWS_REGION environment variables.
183-
region = "eu-de"
184-
185-
# (Required) Skip credentials validation via the STS API.
186-
# It's mandatory for OpenTelekomClou.
187-
skip_credentials_validation = true
188-
189-
# (Required) Skip validation of provided region name.
190-
# It's mandatory for OpenTelekomCloud.
191-
skip_region_validation = true
192-
193-
skip_requesting_account_id = true
194-
195-
# (Required) Skip usage of EC2 Metadata API.
196-
# It's mandatory for OpenTelekomCloud.
197-
skip_metadata_api_check = true
198-
199-
# (Optional) Do not include checksum when uploading S3 Objects.
200-
# Useful for some S3-Compatible APIs.
201-
skip_s3_checksum = true
202-
203-
# Although the terraform block does not accept variables or locals and
204-
# all backend configuration values must be hardcoded, you can provide
205-
# the credentials via the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
206-
# environment variables to access OBS, respectively:
207-
#
208-
# export AWS_ACCESS_KEY_ID="your accesskey"
209-
# export AWS_SECRET_ACCESS_KEY="your secretkey"
210-
#
211-
# secret_key set env var: AWS_ACCESS_KEY_ID
212-
# access_key set env var: AWS_SECRET_ACCESS_KEY
213-
214-
}
215-
216-
}
217-
218-
# ----------------------------------------------------------------------------
219-
# Providers settings --> OTC
220-
# We use the AKSK auth scheme
221-
# See https://registry.terraform.io/providers/opentelekomcloud/opentelekomcloud/latest/docs
222-
# ----------------------------------------------------------------------------
223-
#
224-
225-
provider "opentelekomcloud" {
226-
auth_url = "https://iam.eu-de.otc.t-systems.com/v3"
227-
228-
access_key = var.OTC_SDK_AK
229-
secret_key = var.OTC_SDK_SK
230-
231-
domain_name = var.OTC_SDK_DOMAIN_NAME
232-
tenant_name = var.OTC_SDK_PROJECTNAME
233-
234-
}
94+
.. literalinclude:: /../../samples-doc/doc-sample-deploy-tf/src/main/tf/provider.tf
95+
:language: terraform
96+
:caption: src/main/tf/provider.tf
23597

23698

23799
Backend state bucket
238100
^^^^^^^^^^^^^^^^^^^^
239101

240-
As you cannot create the state bucket in this terraform setup,
241-
you have to create it using OpenTelekomCloud OBS console with
242-
bucket name as defined in ``provider.tf`` file for ``bucket``.
102+
Terraform must store state about your managed infrastructure and configuration.
103+
This state is used by Terraform to map real world resources to your configuration,
104+
keep track of metadata, and to improve performance for large infrastructures.
105+
106+
See: `Terraform State <https://developer.hashicorp.com/terraform/language/state>`_
107+
108+
.. note::
109+
110+
As you cannot create the state bucket in this terraform setup,
111+
you have to create it either:
112+
113+
* using OpenTelekomCloud OBS console with bucket name as defined in ``provider.tf`` file for ``bucket``.
114+
115+
* using the OpenTelekomCloud CLI with command `s3cmd <https://github.com/opentelekomcloud/obs-s3/blob/master/s3cmd/README.md>`_
116+
117+
.. code-block:: shell
118+
119+
s3cmd \
120+
--access_key=${OTC_SDK_AK} \
121+
--secret_key=${OTC_SDK_SK} \
122+
--no-ssl \
123+
mb s3://<bucket_name>

0 commit comments

Comments
 (0)