CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-com-amazonaws--aws-java-sdk-lambda

AWS Java SDK client for communicating with AWS Lambda Service for function management, invocation, and resource control

Pending
Overview
Eval results
Files

tagging.mddocs/

Resource Tagging

Resource tagging enables metadata management for Lambda functions and resources, supporting organization, cost allocation, access control, and automation workflows.

Capabilities

Tag Resource

Adds metadata tags to a Lambda function for organization, cost tracking, and access control.

/**
 * Adds tags to a function
 * @param tagResourceRequest - Request specifying resource ARN and tags to add
 * @return TagResourceResult confirming successful tagging
 */
TagResourceResult tagResource(TagResourceRequest tagResourceRequest);

Usage Example:

import com.amazonaws.services.lambda.*;
import com.amazonaws.services.lambda.model.*;
import java.util.HashMap;
import java.util.Map;

AWSLambda lambdaClient = AWSLambdaClientBuilder.standard()
    .withRegion("us-east-1")
    .build();

// Add tags to a function
Map<String, String> tags = new HashMap<>();
tags.put("Environment", "production");
tags.put("Team", "backend");
tags.put("Project", "user-service");
tags.put("CostCenter", "engineering");

TagResourceRequest tagRequest = new TagResourceRequest()
    .withResource("arn:aws:lambda:us-east-1:123456789012:function:my-function")
    .withTags(tags);

TagResourceResult result = lambdaClient.tagResource(tagRequest);
System.out.println("Tags added successfully");

Untag Resource

Removes specified tags from a Lambda function.

/**
 * Removes tags from a function
 * @param untagResourceRequest - Request specifying resource ARN and tag keys to remove
 * @return UntagResourceResult confirming successful tag removal
 */
UntagResourceResult untagResource(UntagResourceRequest untagResourceRequest);

Usage Example:

import java.util.Arrays;

// Remove specific tags from a function
UntagResourceRequest untagRequest = new UntagResourceRequest()
    .withResource("arn:aws:lambda:us-east-1:123456789012:function:my-function")
    .withTagKeys(Arrays.asList("Environment", "OldTag"));

UntagResourceResult untagResult = lambdaClient.untagResource(untagRequest);
System.out.println("Tags removed successfully");

List Tags

Retrieves all tags associated with a Lambda function.

/**
 * Returns a function's tags
 * @param listTagsRequest - Request specifying the resource ARN
 * @return ListTagsResult containing all tags for the resource
 */
ListTagsResult listTags(ListTagsRequest listTagsRequest);

Usage Example:

// List all tags for a function
ListTagsRequest listRequest = new ListTagsRequest()
    .withResource("arn:aws:lambda:us-east-1:123456789012:function:my-function");

ListTagsResult listResult = lambdaClient.listTags(listRequest);
Map<String, String> functionTags = listResult.getTags();

System.out.println("Function tags:");
for (Map.Entry<String, String> tag : functionTags.entrySet()) {
    System.out.println("  " + tag.getKey() + ": " + tag.getValue());
}

Types

// Tag resource request
public class TagResourceRequest {
    private String resource;
    private java.util.Map<String, String> tags;
    // ... getters and setters
}

// Untag resource request  
public class UntagResourceRequest {
    private String resource;
    private java.util.List<String> tagKeys;
    // ... getters and setters
}

// List tags request
public class ListTagsRequest {
    private String resource;
    // ... getters and setters
}

// List tags result
public class ListTagsResult {
    private java.util.Map<String, String> tags;
    // ... getters and setters
}

Tag Best Practices

Consistent Naming: Use consistent tag key naming conventions across your organization.

Required Tags: Implement required tags for cost center, environment, and owner identification.

Automation: Use tags to drive automation workflows and resource lifecycle management.

Cost Allocation: Leverage tags for detailed cost tracking and chargeback processes.

Access Control: Use tag-based IAM policies to control resource access.

Tag Limitations

  • Maximum 50 tags per function
  • Tag keys and values are case-sensitive
  • Tag keys cannot start with "aws:" (reserved prefix)
  • Maximum key length: 128 characters
  • Maximum value length: 256 characters

Install with Tessl CLI

npx tessl i tessl/maven-com-amazonaws--aws-java-sdk-lambda

docs

account-settings.md

alias-version-management.md

client-management.md

concurrency-performance.md

event-source-mapping.md

function-invocation.md

function-management.md

function-url-management.md

high-level-invocation.md

index.md

layer-management.md

permissions-policies.md

runtime-management.md

security-code-signing.md

tagging.md

waiters-polling.md

tile.json