@@ -98,6 +98,12 @@ async function run() {
9898 const configCommand = new GetFunctionConfigurationCommand({FunctionName: functionName});
9999 let currentConfig = await client.send(configCommand);
100100
101+ // Check if package type is being changed (not supported by AWS)
102+ if (currentConfig.PackageType && currentConfig.PackageType !== packageType) {
103+ core.setFailed(`Cannot change package type of existing Lambda function from ${currentConfig.PackageType} to ${packageType}`);
104+ return;
105+ }
106+
101107 const configChanged = hasConfigurationChanged(currentConfig, {
102108 ...(role && { Role: role }),
103109 ...(handler && { Handler: handler }),
@@ -89375,6 +89381,12 @@ function validateRequiredInputs() {
8937589381
8937689382 handler = core.getInput('handler', { required: false }) || 'index.handler';
8937789383 runtime = core.getInput('runtime', { required: false }) || 'nodejs20.x';
89384+
89385+ // Warn if Image-only parameters are provided with Zip package type
89386+ imageUri = core.getInput('image-uri', { required: false });
89387+ if (imageUri) {
89388+ core.warning('image-uri parameter is ignored when package-type is "Zip"');
89389+ }
8937889390
8937989391 } else if (packageType === 'Image') {
8938089392 // For Image packages, require image-uri
@@ -89388,8 +89400,11 @@ function validateRequiredInputs() {
8938889400 handler = core.getInput('handler', { required: false });
8938989401 runtime = core.getInput('runtime', { required: false });
8939089402
89391- // code-artifacts-dir is not needed for container images
89403+ // Warn if Zip-only parameters are provided with Image package type
8939289404 codeArtifactsDir = core.getInput('code-artifacts-dir', { required: false });
89405+ if (codeArtifactsDir) {
89406+ core.warning('code-artifacts-dir parameter is ignored when package-type is "Image"');
89407+ }
8939389408 }
8939489409
8939589410 return {
@@ -89630,6 +89645,24 @@ function validateAndResolvePath(userPath, basePath) {
8963089645 return resolvedPath;
8963189646}
8963289647
89648+ function checkInputConflicts(packageType, additionalInputs) {
89649+ const { s3Bucket, s3Key, useS3Method } = additionalInputs;
89650+ const sourceKmsKeyArn = core.getInput('source-kms-key-arn', { required: false });
89651+
89652+ if (packageType === 'Image') {
89653+ // Warn about S3-related parameters being ignored for Image package type
89654+ if (s3Bucket) {
89655+ core.warning('s3-bucket parameter is ignored when package-type is "Image"');
89656+ }
89657+ if (s3Key) {
89658+ core.warning('s3-key parameter is ignored when package-type is "Image"');
89659+ }
89660+ if (sourceKmsKeyArn) {
89661+ core.warning('source-kms-key-arn parameter is ignored when package-type is "Image"');
89662+ }
89663+ }
89664+ }
89665+
8963389666function validateAllInputs() {
8963489667 const requiredInputs = validateRequiredInputs();
8963589668 if (!requiredInputs.valid) {
@@ -89652,6 +89685,11 @@ function validateAllInputs() {
8965289685 }
8965389686
8965489687 const additionalInputs = getAdditionalInputs();
89688+
89689+ // Check for input conflicts based on package type
89690+ if (requiredInputs.packageType) {
89691+ checkInputConflicts(requiredInputs.packageType, additionalInputs);
89692+ }
8965589693
8965689694 return {
8965789695 valid: true,
0 commit comments