Skip to content

Commit

Permalink
cli init aws tags option
Browse files Browse the repository at this point in the history
  • Loading branch information
RikishK committed Nov 19, 2024
1 parent bb237b8 commit 00be0f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion metaflow/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,13 @@ def step(
default=None,
help="Tags for this instance of the step.",
)
@click.option(
"--aws-tags",
multiple=True,
default=None,
help="AWS tags.")
@click.pass_obj
def init(obj, run_id=None, task_id=None, tags=None, **kwargs):
def init(obj, run_id=None, task_id=None, tags=None, aws_tags=None, **kwargs):
# init is a separate command instead of an option in 'step'
# since we need to capture user-specified parameters with
# @add_custom_parameters. Adding custom parameters to 'step'
Expand All @@ -515,6 +520,7 @@ def init(obj, run_id=None, task_id=None, tags=None, **kwargs):
# variables.

obj.metadata.add_sticky_tags(tags=tags)
obj.metadata.add_sticky_tags(tags=aws_tags)

runtime = NativeRuntime(
obj.flow,
Expand Down
2 changes: 1 addition & 1 deletion metaflow/plugins/aws/step_functions/step_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ def _step_cli(self, node, paths, code_package_url, user_code_retries):
if self.tags:
step.extend("--tag %s" % tag for tag in self.tags)
if self.aws_tags:
step.extend("--aws-tag %s" % aws_tag for aws_tag in self.aws_tags)
step.extend("--aws-tags %s" % aws_tag for aws_tag in self.aws_tags)
if self.namespace is not None:
step.append("--namespace=%s" % self.namespace)
cmds.append(" ".join(entrypoint + top_level + step))
Expand Down

0 comments on commit 00be0f0

Please sign in to comment.