-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11652 from blake-wilson/add-flink-support
Support Apache Flink runtime for Kinesis Analytics
- Loading branch information
Showing
10 changed files
with
7,254 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package finder | ||
|
||
import ( | ||
"github.com/aws/aws-sdk-go/aws" | ||
"github.com/aws/aws-sdk-go/service/kinesisanalyticsv2" | ||
) | ||
|
||
// ApplicationByName returns the application corresponding to the specified name. | ||
func ApplicationByName(conn *kinesisanalyticsv2.KinesisAnalyticsV2, name string) (*kinesisanalyticsv2.ApplicationDetail, error) { | ||
input := &kinesisanalyticsv2.DescribeApplicationInput{ | ||
ApplicationName: aws.String(name), | ||
} | ||
|
||
output, err := conn.DescribeApplication(input) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return output.ApplicationDetail, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package waiter | ||
|
||
import ( | ||
"github.com/aws/aws-sdk-go/aws" | ||
"github.com/aws/aws-sdk-go/service/kinesisanalyticsv2" | ||
"github.com/hashicorp/aws-sdk-go-base/tfawserr" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" | ||
"github.com/terraform-providers/terraform-provider-aws/aws/internal/service/kinesisanalyticsv2/finder" | ||
) | ||
|
||
const ( | ||
applicationStatusNotFound = "NotFound" | ||
applicationStatusUnknown = "Unknown" | ||
) | ||
|
||
// ApplicationStatus fetches the Application and its Status | ||
func ApplicationStatus(conn *kinesisanalyticsv2.KinesisAnalyticsV2, name string) resource.StateRefreshFunc { | ||
return func() (interface{}, string, error) { | ||
application, err := finder.ApplicationByName(conn, name) | ||
|
||
if tfawserr.ErrCodeEquals(err, kinesisanalyticsv2.ErrCodeResourceNotFoundException) { | ||
return nil, applicationStatusNotFound, nil | ||
} | ||
|
||
if err != nil { | ||
return nil, applicationStatusUnknown, err | ||
} | ||
|
||
return application, aws.StringValue(application.ApplicationStatus), nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package waiter | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/aws/aws-sdk-go/service/kinesisanalyticsv2" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" | ||
) | ||
|
||
// ApplicationDeleted waits for an Application to return Deleted | ||
func ApplicationDeleted(conn *kinesisanalyticsv2.KinesisAnalyticsV2, name string, timeout time.Duration) (*kinesisanalyticsv2.ApplicationDetail, error) { | ||
stateConf := &resource.StateChangeConf{ | ||
Pending: []string{kinesisanalyticsv2.ApplicationStatusDeleting}, | ||
Target: []string{}, | ||
Refresh: ApplicationStatus(conn, name), | ||
Timeout: timeout, | ||
} | ||
|
||
outputRaw, err := stateConf.WaitForState() | ||
|
||
if v, ok := outputRaw.(*kinesisanalyticsv2.ApplicationDetail); ok { | ||
return v, err | ||
} | ||
|
||
return nil, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.