Skip to content

Provisions and configures a Liberty as a Service instance into an IBM Cloud account.

License

Notifications You must be signed in to change notification settings

terraform-ibm-modules/terraform-ibm-enterprise-app-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enterprise Application Service for Java

Incubating (Not yet consumable) latest release pre-commit Renovate enabled semantic-release

Use this module to provision and configure an Enterprise Application Service (also shorthened to EASeJava or simply to ease) instance on IBM Cloud.

For more information about the Enterprice Application Service product you can refer to the product documentation

Overview

Enterprise Application Service use cases support

This module supports both the use cases provided by the Enterprise Application Service:

  • Deploy and Run your application use case: you can provide your existing prebuilt enterprise archive (EAR) or web archive (WAR) file in a Maven artifact repository, the service will allow to deploy and to run it.
  • Build, deploy and run your application use case: you can provide your application source code through its GitHub repository URL, the service will allow to build, deploy and then run it.

For more details about the two different use-cases and the input parameters to use please refer to the sections below.

Mandatory input parameters for both the use cases

Both the use-cases supported by this module need you to specify the following parameters as mandatory inputs.

  1. The IBM Cloud API Key (https://cloud.ibm.com/iam/apikeys) for the account where to deploy the Enterprise Application Service instance
  2. Resource Group ID (https://cloud.ibm.com/account/resource-groups) containing the Enterprise Application Service instance

Deploy and Run use case input parameters

The following optional input parameters are required in order to pre-configure the Enterprise Application Service instance for the Deploy and Run use case:

  1. URL of the Maven artifact repository storing the existing prebuilt enterprise archive (EAR) or web archive (WAR) file to run in the Enterprise Application Service instance
    1. If your Maven artifact repository needs basic authentication, you can specify the username and password using the related input variables. If the repository doesn't need authentication, you can leave them to their default values.
  2. URL of the GitHub repository storing the application deployment configuration to run in the Enterprise Application Service instance
  3. GitHub token with read access to the configuration repository.

Note: all these parameters (excluding the Maven repository username and password) are mandatory in the case any of them is different than their default null value (the GitHub token is mandatory also if the configuration repository is public). When all of them are left to the default null value it will be possible to configure the instance with their values once the instance is successfully created, as describe here

The GitHub configuration repository must satisfy a further prerequisite as described here

For more details about this use-case please refer to the Enterprise Application Service product documentation section available here

Build, Deploy and Run use case input parameters

The following optional input parameters are required in order to pre-configure the Enterprise Application Service instance for the Build, deploy and run use case:

  1. URL of the GitHub repository storing your application source code to Build, deploy and run in the Enterprise Application Service instance
  2. URL of the GitHub repository storing your application configuration to Build, deploy and run in the Enterprise Application Service instance
  3. GitHub token with read access the source code and configuration repositories.

Note: all these parameters are mandatory in the case any of them is different than their default null value (the GitHub token is mandatory also if both the repositories are public). When all of them are left to the default null value it will be possible to configure the instance with their values once the instance is successfully created, as describe here

Both the repositories must satisfy a further prerequisite as described here

For more details about this use-case please refer to the Enterprise Application Service product documentation section available here

IBM AppFlow GitHub application prerequisite

In order to configure the Enterprise Application Service instance to build the Java liberty application using the source code and the configuration repositories, the GitHub application IBM AppFlow must installed in the GitHub organization(s) hosting the repositories and enable to access both of them.

To install and configure the IBM AppFlow GitHub application refer to https://github.com/apps/ibm-enterprise-application-service

Note: in the case you need to configure an Enterprise Application Service instance in an environment different from IBM Cloud public platform, you need to install and configure a specific version of the IBM AppFlow GitHub application.

Create an Enterprise Application Service instance without setting any repository

This module also supports to create an instance of the Enterprise Application Service without setting any source (GitHub or Maven) and configuration repository: in this case it will be possible to configure them through the Enterprise Application Service dashboard accessible through the dashboard URL returned in the ease_instance output details of this module.

Java liberty sample application

For an example of source code and configuration repositories to Build, deploy and run in an Enterprise Application Service instance you can fork the repositories below:

terraform-ibm-enterprise-app-java

Usage

provider "ibm" {
  ibmcloud_api_key = "XXXXXXXXXX" <!-- pragma: allowlist secret -->
}

module "ease_module" {
  # Replace "master" with a GIT release version to lock into a specific release
  source           = "git::https://github.com/terraform-ibm-modules/terraform-ibm-enterprise-app-java.git?ref=master"
  ease_name         = "your-ease-app-name"
  resource_group_id = module.resource_group.resource_group_id
  tags              = var.resource_tags
  plan              = var.plan
  region            = var.region
  config_repo       = var.config_repo
  source_repo       = var.source_repo
  repos_git_token   = var.repos_git_token <!-- pragma: allowlist secret -->
}

Required IAM access policies

You need the following permissions to run this module:

  • IAM services
    • enterprise-application-service service
      • Editor platform access

Requirements

Name Version
terraform >= 1.3.0
ibm >= 1.67.0, < 2.0.0

Modules

No modules.

Resources

Name Type
ibm_resource_instance.ease_instance resource

Inputs

Name Description Type Default Required
config_repo The URL for the repository storing the configuration to use for the application to run through Enterprise Application Service on IBM Cloud. string null no
ease_name The name for the newly provisioned Enterprise Application Service instance. string n/a yes
maven_repository_password Maven repository authentication password if needed. Default to null. string null no
maven_repository_username Maven repository authentication username if needed. Default to null. string null no
plan The desired pricing plan for Enterprise Application Service instance. string "standard" no
region The desired region for deploying Enterprise Application Service instance. string "us-east" no
repos_git_token The GitHub token to read from the application and configuration repositories. It cannot be null if var.source_repo and var.config_repo are not null. string null no
resource_group_id The ID of the resource group to use for the creation of the Enterprise Application Service instance. string n/a yes
source_repo The URL for the repository storing the source code of the application or the URL of the Maven artifact repository storing the existing prebuilt archive (WAR or EAR) to deploy and run through Enterprise Application Service on IBM Cloud. string null no
source_repo_type Type of the source code repository. For maven source repository type, use value maven. Git for GitHub repository. Default value set to git. string "git" no
subscription_id ID of the subscription to use to create the Enterprise Application Service instance. string n/a yes
tags Metadata labels describing the service instance, i.e. test list(string) [] no

Outputs

Name Description
ease_instance Enterprise Application Service instance details

Contributing

You can report issues and request features for this module in GitHub issues in the module repo. See Report an issue or request a feature.

To set up your local development environment, see Local development setup in the project documentation.