From 3430e9cc8aa83d5f52898b3030b917638647f93b Mon Sep 17 00:00:00 2001 From: EarthmanT Date: Sun, 8 Oct 2023 12:34:17 -0400 Subject: [PATCH 1/3] publish 1.5 DSL plugin YAML --- CHANGELOG.txt | 1 + cloudify_tg/__version__.py | 2 +- plugin.yaml | 2 +- plugin_1_4.yaml | 2 +- plugin_1_5.yaml | 248 +++++++++++++++++++++++++++++++++++++ v2_plugin.yaml | 2 +- 6 files changed, 253 insertions(+), 4 deletions(-) create mode 100644 plugin_1_5.yaml diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d926e05..77d52a1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,3 +9,4 @@ 0.0.6: Release 1 4 in place of v2. 0.0.7: add __version__.py file in cloudify_tg folder. 0.0.8: Publish py311 wagon. +0.0.9: Publish 1.5 DSL plugin YAML. \ No newline at end of file diff --git a/cloudify_tg/__version__.py b/cloudify_tg/__version__.py index 09db6a8..c7e390b 100644 --- a/cloudify_tg/__version__.py +++ b/cloudify_tg/__version__.py @@ -1 +1 @@ -version = '0.0.8' +version = '0.0.9' diff --git a/plugin.yaml b/plugin.yaml index 3bad8fb..609c6e7 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -3,7 +3,7 @@ plugins: tg: executor: central_deployment_agent package_name: cloudify-terragrunt-plugin - package_version: '0.0.8' + package_version: '0.0.9' dsl_definitions: diff --git a/plugin_1_4.yaml b/plugin_1_4.yaml index 6d23533..1c49754 100644 --- a/plugin_1_4.yaml +++ b/plugin_1_4.yaml @@ -3,7 +3,7 @@ plugins: tg: executor: central_deployment_agent package_name: cloudify-terragrunt-plugin - package_version: '0.0.8' + package_version: '0.0.9' dsl_definitions: diff --git a/plugin_1_5.yaml b/plugin_1_5.yaml new file mode 100644 index 0000000..1c49754 --- /dev/null +++ b/plugin_1_5.yaml @@ -0,0 +1,248 @@ +plugins: + + tg: + executor: central_deployment_agent + package_name: cloudify-terragrunt-plugin + package_version: '0.0.9' + +dsl_definitions: + + terragrunt_config: &terragrunt_config + terragrunt_config: + type: cloudify.types.terragrunt.DirectoryConfig + description: Terragrunt directories for executions. + required: false + +data_types: + + cloudify.types.terragrunt.DirectoryConfig: + properties: + executable_path: + type: string + description: The path to the terragrunt binary executable. + required: false + + cloudify.types.terragrunt.InstallConfig: + properties: + use_existing_resource: + type: boolean + description: If true, use an existing Terragrunt installation rather than installing it + default: false + installation_source: + type: string + default: 'https://github.com/gruntwork-io/terragrunt/releases/download/v0.50.17/terragrunt_linux_amd64' + description: Location to download the Terraform executable binary from. Ignored if 'use_existing' is true. + + cloudify.types.terragrunt.SourceSpecification: + properties: + location: + type: string + description: > + Path or URL to the ZIP file containing the Terraform project. + If this is a path, then it must be relative to the blueprint's root. + required: true + username: + type: string + description: > + Username to authenticate with + required: false + password: + type: string + description: > + Password to authenticate with + required: false + + cloudify.types.terragrunt.Stack: + properties: + binary_path: + type: string + description: The path to the Terragrunt binary on your system. This may also be provided through a relationship to a cloudify.nodes.Terragrunt node template. + required: false + terraform_binary_path: + type: string + description: The path to the Terraform binary on your system. This may also be provided through a relationship to a cloudify.nodes.terraform node template. + required: false + source: + type: cloudify.types.terragrunt.SourceSpecification + description: Specification of Terragrunt Stack archive's source. + required: true + source_path: + type: string + description: The path within the source property, where the terragrunt files may be found. + default: '' + variables: + type: dict + description: A dictionary of variables. + default: {} + environment_variables: + type: dict + description: A dictionary of environment variables. + default: {} + run_all: + type: boolean + description: run all executes commands such as plan, apply, destroy, output in all modules in a stack. + default: false + command_options: + type: dict + description: | + Custom options that you wish to add to terragrunt commands when they are executed. + For example, if you want different log level for apply and destroy, the you can provide this dict: + apply: '["--terragrunt-log-level", "info"]' + destroy: '["--terragrunt-log-level", "debug"]' + default: + all: ["--terragrunt-non-interactive", "--terragrunt-log-level", "debug"] + apply: ["-auto-approve"] + destroy: ["-auto-approve"] + plan: ["-json"] + output: ["-json"] + masked_env_vars: + type: list + default: ['AWS_SECRET_ACCESS_KEY', 'AWS_ACCESS_KEY_ID', 'AWS_DEFAULT_REGION'] + +relationships: + cloudify.relationships.terragrunt.depends_on: + derived_from: cloudify.relationships.depends_on + + cloudify.relationships.terraform.depends_on: + derived_from: cloudify.relationships.depends_on + +node_types: + + # Represents a Terragrunt installation. + cloudify.nodes.terragrunt: + derived_from: cloudify.nodes.SoftwareComponent + properties: + <<: *terragrunt_config + resource_config: + type: cloudify.types.terragrunt.InstallConfig + required: true + interfaces: + cloudify.interfaces.lifecycle: + create: + implementation: tg.cloudify_tg.tasks.install + delete: + implementation: tg.cloudify_tg.tasks.uninstall + + # Represents a Terragrunt Stack. + cloudify.nodes.terragrunt.Stack: + derived_from: cloudify.nodes.ApplicationModule + properties: + resource_config: + type: cloudify.types.terragrunt.Stack + required: true + interfaces: + cloudify.interfaces.lifecycle: + precreate: + implementation: tg.cloudify_tg.tasks.precreate + create: + implementation: tg.cloudify_tg.tasks.create + poststart: + implementation: tg.cloudify_tg.tasks.poststart + delete: + implementation: tg.cloudify_tg.tasks.delete + terragrunt: + terragrunt_plan: + implementation: tg.cloudify_tg.tasks.terragrunt_plan + inputs: &command_options + options: + default: {} + description: > + A list of options to extend the command list. + source: + type: string + description: URL for terragrunt stack archive. + default: { get_property: [ SELF, resource_config, source ] } + source_path: + type: string + description: The path inside of source archive. + default: { get_property: [ SELF, resource_config, source_path ] } + run_command: + implementation: tg.cloudify_tg.tasks.run_command + inputs: + command: + default: "" + description: The command name, for example, if you wish to run "terragrunt apply", then the command input is "apply". + <<: *command_options + force: + default: false + description: We will run any command you send. + terragrunt_destroy: + implementation: tg.cloudify_tg.tasks.terragrunt_destroy + inputs: + <<: *command_options + terragrunt_output: + implementation: tg.cloudify_tg.tasks.terragrunt_output + inputs: + <<: *command_options + terragrunt_apply: + implementation: tg.cloudify_tg.tasks.terragrunt_apply + inputs: + <<: *command_options + destroy: + type: boolean + default: false + description: destroy existing installation in order to avoid dependency errors. + terragrunt_info: + implementation: tg.cloudify_tg.tasks.terragrunt_info + inputs: + <<: *command_options + validate_inputs: + implementation: tg.cloudify_tg.tasks.validate_inputs + inputs: + <<: *command_options + graph_dependencies: + implementation: tg.cloudify_tg.tasks.graph_dependencies + inputs: + <<: *command_options + render_json: + implementation: tg.cloudify_tg.tasks.render_json + inputs: + <<: *command_options + + +workflows: + + terragrunt_plan: + mapping: tg.cloudify_tg.workflows.terragrunt_plan + parameters: &terragrunt_workflow_params + node_instance_ids: + type: list + default: [] + item_type: node_instance + description: | + List of node instance ID's to refresh for. + node_ids: + type: list + default: [] + item_type: node_id + description: | + List of node templates to refresh for. + source: + type: string + default: '' + description: | + URL for terragrunt stack archive. + source_path: + type: string + default: '' + description: | + The path inside of source archive. + + terragrunt_apply: + mapping: tg.cloudify_tg.workflows.terragrunt_apply + parameters: + <<: *terragrunt_workflow_params + destroy: + type: boolean + description: Destroy existing installation in order to avoid dependency errors. + default: false + +blueprint_labels: + obj-type: + values: + - terragrunt + +labels: + obj-type: + values: + - terragrunt diff --git a/v2_plugin.yaml b/v2_plugin.yaml index 97dc156..96e43ce 100644 --- a/v2_plugin.yaml +++ b/v2_plugin.yaml @@ -3,7 +3,7 @@ plugins: tg: executor: central_deployment_agent package_name: cloudify-terragrunt-plugin - package_version: '0.0.8' + package_version: '0.0.9' dsl_definitions: From ac8a3bff66ee559b09e8330f43da6d8e2396d51b Mon Sep 17 00:00:00 2001 From: EarthmanT Date: Sun, 8 Oct 2023 15:22:29 -0400 Subject: [PATCH 2/3] making changes --- constraints.txt | 9 --------- dev-requirements.txt | 1 - setup.py | 3 +-- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/constraints.txt b/constraints.txt index 3d2e9b7..e69de29 100644 --- a/constraints.txt +++ b/constraints.txt @@ -1,9 +0,0 @@ -# cloudify-utilities-plugins-sdk>=0.0.61 -urllib3==1.24.3 -networkx==2.5.1 -cryptography>=40.0.2 -pynacl==1.4.0 -decorator==4.4.2 -gitdb>=4.0.1,<5 -decorator==4.4.2 -psutil==5.8.0 diff --git a/dev-requirements.txt b/dev-requirements.txt index 9c3ff03..e69de29 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1 +0,0 @@ -cloudify-utilities-plugins-sdk diff --git a/setup.py b/setup.py index 03667d8..2190f02 100644 --- a/setup.py +++ b/setup.py @@ -37,9 +37,8 @@ def get_version(): packages=['cloudify_tg', 'tg_sdk'], license='LICENSE', install_requires=[ - "Pathlib", "cloudify-common>=6.4", - "cloudify-utilities-plugins-sdk>=0.0.61", + "cloudify-utilities-plugins-sdk>=0.0.127", ], test_requires=[] ) From 676b07af430b34a2d7f615b044388a95a98d4c8d Mon Sep 17 00:00:00 2001 From: EarthmanT Date: Sun, 8 Oct 2023 15:35:06 -0400 Subject: [PATCH 3/3] improvements --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4a157b8..494e1f0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,6 +58,7 @@ commands: echo "Failed to get manager status"; exit 1 fi + - run: pip3 install urllib3==1.26.15 requests-toolbelt==0.10.1 - run: pip3 install https://github.com/cloudify-incubator/cloudify-ecosystem-test/archive/refs/heads/master.zip - run: git submodule update --init --recursive --remote