Hello World from Lambda
24 | 25 | """ 26 | return response -------------------------------------------------------------------------------- /application-load-balancer-serverless-app/helloworld/template.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | Transform: AWS::Serverless-2016-10-31 3 | Description: HelloWorld Lambda function template for Application Load Balancer Lambda as target 4 | 5 | Outputs: 6 | HelloWorldFunctionARN: 7 | Description: "ARN of the HelloWorld Lambda function" 8 | Value: !GetAtt HelloWorldFunction.Arn 9 | 10 | 11 | Resources: 12 | HelloWorldFunction: 13 | Type: AWS::Serverless::Function 14 | Properties: 15 | Description: An Application Load Balancer Lambda Target that returns "HelloWorld" 16 | Handler: helloworld.lambda_handler 17 | Runtime: python3.8 18 | CodeUri: ./ 19 | Timeout: 300 20 | 21 | -------------------------------------------------------------------------------- /application-load-balancer-serverless-app/uploadfile_to_s3/README.md: -------------------------------------------------------------------------------- 1 | # ALB-Lambda-Target-UploadFiletoS3 2 | 3 | A sample Lambda function template that works with Application Load Balancer. You can upload a binary file (e.g. an image or video file) to your S3 bucket with a **POST** request to trigger this Lambda function through your Application Load Balancer. 4 | 5 | 6 | You need to use query string parameter to specify the S3 bucket , S3 Object Key (file name) that the Lambda function can use to upload the file as an object to S3. 7 | 8 | For example, to upload an image file -- logo.png as test.png to the S3 bucket -- myBucket: 9 | 10 | ``` 11 | curl -ivv -X POST -H "Content-Type: image/png" -F "data=@logo.png" "http(s)://<27 | 28 |
29 |You can also get text output by using query string: "?output=text"
31 |or JSON by using query string: "?output=json"
32 | 33 |{} | ".format(colunm) 130 | html += "||||
---|---|---|---|---|
{} | '''.format(attribute, attribute.split('=')[-1]) 136 | else: 137 | html += "{} | ".format(attribute) 138 | html = """
{} | ".format(column) 142 | html += "|
---|---|
{} | '''.format(attribute, attribute.split('=')[-1]) 148 | else: 149 | html += "{} | ".format(attribute) 150 | html += "
Indicates whether {@link #read(InputStream)} returns the TLVs this object does not have
63 | * adapters for. If true
the unrecognized TLVs are returned as {@link TlvRaw}s.
64 | *
By default returns true
.
If true
, enforce the checksum when reading and writing the protocol header.
80 | * When reading, calculate the checksum and throw {@link InvalidHeaderException} if
81 | * the checksum does not match the checksum specified in the header or the header does not
82 | * include the checksum. Generate the checksum when writing.
If false
, the checksum is ignored when reading and is not generated when
85 | * writing.
86 | *
The checksum is not exposed as a TLV object even though according to the protocol 89 | * specification it is stored as a TLV. 90 | *
91 | * 92 | *By default returns true
.
Checksum processing approximately doubles processing time of a header.
95 | * 96 | */ 97 | public boolean isEnforceChecksum() { 98 | return enforceChecksum; 99 | } 100 | 101 | public void setEnforceChecksum(boolean enforceChecksum) { 102 | this.enforceChecksum = enforceChecksum; 103 | } 104 | 105 | /** 106 | * If specified, the class generates Proxy Protocol headers of the specified size if necessary 107 | * padding the header with the {@link ProxyProtocolSpec#PP2_TYPE_NOOP} TLV. 108 | * {@link #write(Header, OutputStream)} throws {@link InvalidHeaderException} if the size of 109 | * the generated header is greater than the specified size. Due to the restriction of the Proxy 110 | * Protocol the exception is also thrown when the generated header is smaller than the 111 | * specified size by 1 or 2 bytes. 112 | * @return by default returns {@link Optional#empty()} 113 | */ 114 | public Optional