#jinja2: variable_start_string: '[%', variable_end_string: '%]'
apiVersion: unfurl/v1alpha1
kind: Project
[%include | default("") %]

{%- if default_context | default("") %}
default_environment: [%default_context%]
{% endif %}

environments:
  # This is the home project so the environment settings defined here are inherited
  # whenever UNFURL_HOME is set to this project.
  # So it is convenient to define global configuration here.

  defaults:
    # this exposes this project's ensemble as "localhost" to all the projects
    # that inherit this context
    external:
      localhost:
        manifest:
          file: [% manifestPath | default("ensemble/ensemble.yaml", true) %]
        instance: localhost

  home:

    # Below we define a few connections for the most common cloud providers.
    # Connections will use the appropriate environment variables but they are typed
    # and allow Unfurl to reason about them compared to just setting the variables directly.

    #  The examples below only show some of the available properties for each connection type.
    #  For more properties see https://docs.unfurl.run/toscadef.html#unfurl-types

    # Sensitive values can be set as environment variables in secrets/secrets.yaml or in local/unfurl.yaml
    # depending on whether you want them committed to repository as encrypted values or not.
    # See secrets/secrets.yaml for examples

    # As best practice, connections defined in the home project should be placed outside of defaults
    # to prevent accidentally exposing them to wrong projects.
    # Project that inherit the home can delete or rename the connections defined here
    # by setting its key to the name of one of the connections defined here
    # or in another environment if prefixed with the environment's name
    # or using a merge directive to delete it
    #
    # For example:
    #
    # primary_provider: gcp # set the gcp connection as the primary_provider
    # primary_provider: home:gcp # set the gcp connection defined in the production environment as the primary_provider
    # aws: # delete the aws connection
    #   +%: whiteout

    # connections:
      # aws:
      #   type: unfurl.relationships.ConnectsTo.AWSAccount
      #   properties:
      #      AWS_DEFAULT_REGION: us-east-1
      #      # set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in secrets or local config

      # gcp:
      #   type: unfurl.relationships.ConnectsTo.GoogleCloudProject
      #   properties:
      #     CLOUDSDK_CORE_PROJECT:
      #     CLOUDSDK_COMPUTE_REGION: us-central1
      #     CLOUDSDK_COMPUTE_ZONE: us-central1-a
      #     # place application-credentials.json in the "secrets" so that it is automatically encrypted
      #     GOOGLE_APPLICATION_CREDENTIALS: "{{ 'secrets/application-credentials.json' | abspath('src') }}"

      #      #  For more properties see https://docs.unfurl.run/toscadef.html#unfurl-types
      #
      # azure:
      #   type: unfurl.relationships.ConnectsTo.Azure
      #   properties:
      #     AZURE_CLIENT_ID:

      # k8s:
      #   type: unfurl.relationships.ConnectsTo.K8sCluster
      #   properties:
      #     context:

      # packet:
      #   type: unfurl.relationships.ConnectsTo.Packet
      #   properties:
      #     project: # required property, need to set this
