Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_lambda_event_source_mapping: Support reading starting_position fields #19253

Merged
merged 10 commits into from
May 7, 2021
3 changes: 3 additions & 0 deletions .changelog/19253.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_lambda_event_source_mapping: Support reading `starting_position` and `starting_position_timestamp` attributes
```
7 changes: 7 additions & 0 deletions aws/resource_aws_lambda_event_source_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,13 @@ func resourceAwsLambdaEventSourceMappingRead(d *schema.ResourceData, meta interf
return fmt.Errorf("error setting topics: %w", err)
}

d.Set("starting_position", eventSourceMappingConfiguration.StartingPosition)
if eventSourceMappingConfiguration.StartingPositionTimestamp != nil {
d.Set("starting_position_timestamp", aws.TimeValue(eventSourceMappingConfiguration.StartingPositionTimestamp).Format(time.RFC3339))
} else {
d.Set("starting_position_timestamp", nil)
}

state := aws.StringValue(eventSourceMappingConfiguration.State)

switch state {
Expand Down
Loading