Skip to content

Commit

Permalink
Merge pull request #3994 from Yelp/u/bpan/allow-custom-service-shard-…
Browse files Browse the repository at this point in the history
…configs

Add support for iam_role in service_shard_update
  • Loading branch information
panbenson authored Dec 16, 2024
2 parents c7348a9 + 629c7cf commit dbe4ada
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions paasta_tools/contrib/service_shard_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ def parse_args():
type=int,
dest="autotune_max_disk",
)
parser.add_argument(
"--iam-role",
help="IAM role to use for the shard",
required=False,
type=str,
dest="iam_role",
)
return parser.parse_args()


Expand Down Expand Up @@ -264,6 +271,8 @@ def main(args):
metrics_provider_config
)

if args.iam_role is not None:
instance_config["iam_role"] = args.iam_role
if args.cpus is not None:
instance_config["cpus"] = args.cpus
if args.mem is not None:
Expand Down Expand Up @@ -306,6 +315,7 @@ def main(args):
# Add the missing definition and write to the corresponding config
if args.shard_name not in config_file.keys():
config_file[args.shard_name] = instance_config

updater.write_configs(
args.service, f"{config_prefix}{config_path}", config_file
)
Expand Down

0 comments on commit dbe4ada

Please sign in to comment.