Which command will meet these requirements?
sam deploy –force-upload
sam deploy –no-execute-changeset
sam package
sam sync –watch
Explanations:
The commandsam deploy –force-uploadforces the upload of all artifacts, which does not meet the requirement to only redeploy changed Lambda functions. It redeploys the entire application stack, leading to unnecessary uploads and longer deployment times.
The commandsam deploy –no-execute-changesetcreates a change set but does not apply it. While it allows reviewing changes, it does not deploy any functions or resources, which does not align with the need to redeploy changed Lambda functions.
The commandsam packageis used to package the application and create a deployment artifact, but it does not deploy anything. It does not address the requirement of redeploying only the changed Lambda functions.
The commandsam sync –watchautomatically detects changes in the code and synchronizes only the updated Lambda functions with the AWS environment. This meets the requirement of redeploying only the changed resources efficiently.