in cli/src/pcluster/templates/imagebuilder_stack.py [0:0]
def _add_cfn_parameters(self):
if (
self.config.dev_settings
and self.config.dev_settings.cookbook
and self.config.dev_settings.cookbook.chef_cookbook
):
dev_settings_cookbook_value = self.config.dev_settings.cookbook.chef_cookbook
custom_chef_cookbook = (
create_s3_presigned_url(dev_settings_cookbook_value)
if dev_settings_cookbook_value.startswith("s3://")
else dev_settings_cookbook_value
)
else:
custom_chef_cookbook = ""
CfnParameter(
self,
"CfnParamCookbookVersion",
type="String",
default=utils.get_installed_version(),
description="CookbookVersion",
)
CfnParameter(
self, "CfnParamChefCookbook", type="String", default=custom_chef_cookbook, description="ChefCookbook"
)
custom_cinc_installer_url = (
self.config.dev_settings.cinc_installer_url
if self.config.dev_settings and self.config.dev_settings.cinc_installer_url
else ""
)
CfnParameter(
self, "CfnParamCincInstaller", type="String", default=custom_cinc_installer_url, description="CincInstaller"
)
CfnParameter(
self,
"CfnParamChefDnaJson",
type="String",
default=ImageBuilderExtraChefAttributes(self.config).dump_json(),
description="ChefAttributes",
)
CfnParameter(
self,
"CfnParamUpdateOsAndReboot",
type="String",
default=(
"true"
if self.config.build
and self.config.build.update_os_packages
and self.config.build.update_os_packages.enabled
else "false"
),
description="UpdateOsAndReboot",
)
CfnParameter(
self,
"CfnParamIsOfficialAmiBuild",
type="String",
default=(
json.loads(self.config.dev_settings.cookbook.extra_chef_attributes)
.get("cluster")
.get("is_official_ami_build")
if self.config.dev_settings
and self.config.dev_settings.cookbook
and self.config.dev_settings.cookbook.extra_chef_attributes
and json.loads(self.config.dev_settings.cookbook.extra_chef_attributes).get("cluster")
and json.loads(self.config.dev_settings.cookbook.extra_chef_attributes)
.get("cluster")
.get("is_official_ami_build")
else "false"
),
description="IsOfficialAmiBuild",
)