Skip to content

Commit

Permalink
Merge pull request hashicorp#15966 from ashishmohite/f-amplify-app
Browse files Browse the repository at this point in the history
Add aws_amplify_app resource
  • Loading branch information
ewbankkit authored May 21, 2021
2 parents d055ffd + 70526bf commit ead8c65
Show file tree
Hide file tree
Showing 12 changed files with 2,105 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/15966.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
aws_amplify_app
```
5 changes: 5 additions & 0 deletions aws/internal/service/amplify/consts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package amplify

const (
StageNone = "NONE"
)
36 changes: 36 additions & 0 deletions aws/internal/service/amplify/finder/finder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package finder

import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/amplify"
"github.com/hashicorp/aws-sdk-go-base/tfawserr"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func AppByID(conn *amplify.Amplify, id string) (*amplify.App, error) {
input := &amplify.GetAppInput{
AppId: aws.String(id),
}

output, err := conn.GetApp(input)

if tfawserr.ErrCodeEquals(err, amplify.ErrCodeNotFoundException) {
return nil, &resource.NotFoundError{
LastError: err,
LastRequest: input,
}
}

if err != nil {
return nil, err
}

if output == nil || output.App == nil {
return nil, &resource.NotFoundError{
Message: "Empty result",
LastRequest: input,
}
}

return output.App, nil
}
3 changes: 3 additions & 0 deletions aws/internal/service/amplify/lister/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//go:generate go run ../../../generators/listpages/main.go -function=ListApps github.com/aws/aws-sdk-go/service/amplify

package lister
31 changes: 31 additions & 0 deletions aws/internal/service/amplify/lister/list_pages_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions aws/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ func Provider() *schema.Provider {
"aws_ami_copy": resourceAwsAmiCopy(),
"aws_ami_from_instance": resourceAwsAmiFromInstance(),
"aws_ami_launch_permission": resourceAwsAmiLaunchPermission(),
"aws_amplify_app": resourceAwsAmplifyApp(),
"aws_api_gateway_account": resourceAwsApiGatewayAccount(),
"aws_api_gateway_api_key": resourceAwsApiGatewayApiKey(),
"aws_api_gateway_authorizer": resourceAwsApiGatewayAuthorizer(),
Expand Down
Loading

0 comments on commit ead8c65

Please sign in to comment.