Creating a project
In a projectA collection of artifacts that define and manage resources and Infrastructure as Code deployments. , you can add deployable architectures from the catalog and edit their configuration. Deploying a configuration from a project groups resources based on the configuration that you deployed.
Before you begin
Resources are created in the project account for the user. You must have permission to create a project and permission to create the project tooling resources within the account. Make sure that you have the following access:
- The Editor role on the IBM Cloud Projects service.
- The Editor and Manager role on the IBM Cloud® Schematics service
- The Viewer role on the resource group for the project
For more information about access and permissions, see Assigning users access to projects.
Adding users to a project
Project access is controlled by IBM Cloud Identity and Access Management (IAM). You add users to a project by granting the Reader role or higher on the project instance. For more information on assigning access to projects, see Assigning users access to projects.
Creating a project by using the console
You can create a project by going to the Navigation menu icon and selecting Projects or from a deployable
architecture in the catalog. Projects can also be created by using the Project API.
Adding a deployable architecture to a project by using the console
Deployable architectures that you add to a project are represented as configurations in the project UI. After you add a deployable architecture to a project, you can edit your configuration before you deploy it. There are a couple of ways to add a deployable architecture to your project.
To add a deployable architecture to your project from the project dashboard, complete the following steps:
- From the project dashboard, select the Configurations tab.
- Click Create.
- Select a deployable architecture from the catalog.
- Click Add to project.
You can also add a deployable architecture to a project directly from the catalog:
- Go to the IBM Cloud catalog.
- Select the deployable architecture.
- Click Add to project.
- You can create a new project or add to an existing project.
- Enter the required details for the deployable architecture.
- Click Add.
To back up the project information outside of the IBM Cloud Projects service, you can export the project. For more information, go to Project JSON.
Check out the steps on how to configure and deploy a deployable architecture when you're ready to deploy resources from a deployable architecture from a project.
Creating a project by using the CLI
To create a project by using the CLI, run the following ibmcloud project create
command:
ibmcloud project create [--definition DEFINITION | --definition-name DEFINITION-NAME --definition-destroy-on-delete=DEFINITION-DESTROY-ON-DELETE --definition-description DEFINITION-DESCRIPTION --definition-auto-deploy=DEFINITION-AUTO-DEPLOY --definition-monitoring-enabled=DEFINITION-MONITORING-ENABLED] --location LOCATION --resource-group RESOURCE-GROUP [--configs CONFIGS] [--environments ENVIRONMENTS]
See ibmcloud project create
for an example command and more information about the command parameters.
Adding deployable architecture to a project by using the CLI
To add a deployable architecture to your project by using the CLI, run the following ibmcloud project config-create
command:
ibmcloud project config-create --project-id PROJECT-ID [--definition DEFINITION | --definition-compliance-profile DEFINITION-COMPLIANCE-PROFILE --definition-locator-id DEFINITION-LOCATOR-ID --definition-description DEFINITION-DESCRIPTION --definition-name DEFINITION-NAME --definition-environment-id DEFINITION-ENVIRONMENT-ID --definition-authorizations DEFINITION-AUTHORIZATIONS --definition-inputs DEFINITION-INPUTS --definition-settings DEFINITION-SETTINGS --definition-members DEFINITION-MEMBERS --definition-resource-crns DEFINITION-RESOURCE-CRNS] [--schematics SCHEMATICS | --schematics-workspace-crn SCHEMATICS-WORKSPACE-CRN]
See ibmcloud project config-create
for an example command and more information about the command parameters.
To back up the project information outside of the IBM Cloud Projects service, you can export the project. For more information, go to Project JSON.
Creating a project by using the API
You can programmatically create a project by calling the Projects API as shown in the following sample request:
curl -X POST --location --header "Authorization: Bearer {iam_token}" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{ "definition": { "name": "acme-microservice", "description": "A microservice to deploy on top of ACME infrastructure.", "authorizations": { "method": "trusted_profile", "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12" } }, "configs": [ { "definition": { "name": "account-stage", "description": "The stage account configuration.", "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global" } }, { "definition": { "name": "env-stage", "description": "The stage environment configuration that includes services common to all the environment regions.", "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global", "inputs": { "account_id": "ref:/configs/account-stage/inputs/account_id", "resource_group": "stage", "access_tags": [ "env:stage" ], "logdna_name": "The name of the LogDNA stage service instance.", "sysdig_name": "The name of the SysDig stage service instance." } } }, { "definition": { "name": "region-us-south-stage", "description": "The stage us-south configuration.", "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global" } }, { "definition": { "name": "region-eu-de-stage", "description": "The stage eu-de configuration.", "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global", "inputs": { "account_id": "ref:/configs/account-stage/inputs/account_id", "resource_group": "ref:/configs/env-stage/outputs/resource_group_id", "logdna_id": "ref:/configs/env-stage/outputs/logdna_id", "sysdig_id": "ref:/configs/env-stage/outputs/sysdig_id", "access_tags": [ "region:eu-de" ] } } } ], "location": "us-south", "resource_group": "Default" }' \
"{base_url}/v1/projects"
Adding a deployable architecture to a project by using the API
You can programmatically add a deployable architecture to an existing project by calling the Projects API and customizing the configuration as shown in the following sample request:
curl -X POST --location --header "Authorization: Bearer {iam_token}" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{ "definition": { "name": "env-stage", "description": "The stage environment configuration.", "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global", "inputs": { "account_id": "account_id", "resource_group": "stage", "access_tags": [ "env:stage" ], "logdna_name": "LogDNA_stage_service", "sysdig_name": "SysDig_stage_service" } } }' \
"{base_url}/v1/projects/{project_id}/configs"
To back up the project information outside of the IBM Cloud Projects service, you can export the project. For more information, go to Project JSON.