Skip to content

Commit

Permalink
remove deploy using docker image
Browse files Browse the repository at this point in the history
currently not supported
  • Loading branch information
Ivan Vlasic committed Aug 27, 2021
1 parent 3c04f55 commit f784a30
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
13 changes: 0 additions & 13 deletions internal/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,6 @@ func (a *AWS) RoleCredentials(name, role, policy string) (*stsTypes.Credentials,
return creds.Credentials, nil
}

func (a *AWS) UpdateLambdaFunctionCodeImage(function, image string) error {
ufci := &lambda.UpdateFunctionCodeInput{
FunctionName: aws.String(function),
ImageUri: aws.String(image),
}

_, err := a.lambdaClient.UpdateFunctionCode(context.Background(), ufci)
if err != nil {
return fmt.Errorf("could not update lambda function %s with image %s", function, image)
}
return nil
}

func (a *AWS) AccountID() (string, error) {
gcio, err := a.stsClient.GetCallerIdentity(context.Background(), &sts.GetCallerIdentityInput{})
if err != nil {
Expand Down
10 changes: 3 additions & 7 deletions internal/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,12 @@ func (d *Deploy) processFunctionUpdate(fu *mantil.FunctionUpdate, action mantil.
f := d.project.Functions[idx]
f.Hash = fu.Hash
f.S3Key = fu.S3Key
f.ImageKey = fu.ImageKey
d.project.Functions[idx] = f
case mantil.Add:
f := mantil.Function{
Name: fu.Name,
Hash: fu.Hash,
S3Key: fu.S3Key,
ImageKey: fu.ImageKey,
Name: fu.Name,
Hash: fu.Hash,
S3Key: fu.S3Key,
}
d.project.Functions = append(d.project.Functions, f)
case mantil.Remove:
Expand Down Expand Up @@ -178,8 +176,6 @@ func (d *Deploy) updateLambdaFunction(f *mantil.FunctionUpdate) error {
var err error
if f.S3Key != "" {
err = d.aws.UpdateLambdaFunctionCodeFromS3(lambdaName, d.project.Bucket, f.S3Key)
} else if f.ImageKey != "" {
err = d.aws.UpdateLambdaFunctionCodeImage(lambdaName, f.ImageKey)
} else {
err = fmt.Errorf("could not update lambda function %s due to missing key", lambdaName)
}
Expand Down

0 comments on commit f784a30

Please sign in to comment.