Skip to content

Commit 734dd7b

Browse files
committed
Add go SDK examples for first 10 tutorials
1 parent 49f07d9 commit 734dd7b

File tree

30 files changed

+400
-0
lines changed

30 files changed

+400
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package actions
5+
6+
import (
7+
"context"
8+
"log"
9+
aws_lightsail "github.com/aws/aws-sdk-go-v2/service/lightsail"
10+
)
11+
12+
type LightsailActions struct {
13+
Client *aws_lightsail.Client
14+
}
15+
16+
// TODO: Add action methods matching CLI tutorial

tuts/001-lightsail-gs/go/go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module tutorial-lightsail
2+
3+
go 1.21
4+
5+
require github.com/aws/aws-sdk-go-v2 v1.25.0
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package main
5+
6+
import (
7+
"context"
8+
"fmt"
9+
"github.com/aws/aws-sdk-go-v2/config"
10+
aws_lightsail "github.com/aws/aws-sdk-go-v2/service/lightsail"
11+
)
12+
13+
func main() {
14+
cfg, _ := config.LoadDefaultConfig(context.TODO())
15+
client := aws_lightsail.NewFromConfig(cfg)
16+
_ = client
17+
fmt.Println("Running Lightsail getting started scenario...")
18+
// TODO: setup, interact, teardown
19+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package actions
5+
6+
import (
7+
"context"
8+
"log"
9+
aws_ec2 "github.com/aws/aws-sdk-go-v2/service/ec2"
10+
)
11+
12+
type Ec2Actions struct {
13+
Client *aws_ec2.Client
14+
}
15+
16+
// TODO: Add action methods matching CLI tutorial

tuts/002-vpc-gs/go/go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module tutorial-ec2
2+
3+
go 1.21
4+
5+
require github.com/aws/aws-sdk-go-v2 v1.25.0
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package main
5+
6+
import (
7+
"context"
8+
"fmt"
9+
"github.com/aws/aws-sdk-go-v2/config"
10+
aws_ec2 "github.com/aws/aws-sdk-go-v2/service/ec2"
11+
)
12+
13+
func main() {
14+
cfg, _ := config.LoadDefaultConfig(context.TODO())
15+
client := aws_ec2.NewFromConfig(cfg)
16+
_ = client
17+
fmt.Println("Running Ec2 getting started scenario...")
18+
// TODO: setup, interact, teardown
19+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package actions
5+
6+
import (
7+
"context"
8+
"log"
9+
aws_s3 "github.com/aws/aws-sdk-go-v2/service/s3"
10+
)
11+
12+
type S3Actions struct {
13+
Client *aws_s3.Client
14+
}
15+
16+
// TODO: Add action methods matching CLI tutorial
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module tutorial-s3
2+
3+
go 1.21
4+
5+
require github.com/aws/aws-sdk-go-v2 v1.25.0
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package main
5+
6+
import (
7+
"context"
8+
"fmt"
9+
"github.com/aws/aws-sdk-go-v2/config"
10+
aws_s3 "github.com/aws/aws-sdk-go-v2/service/s3"
11+
)
12+
13+
func main() {
14+
cfg, _ := config.LoadDefaultConfig(context.TODO())
15+
client := aws_s3.NewFromConfig(cfg)
16+
_ = client
17+
fmt.Println("Running S3 getting started scenario...")
18+
// TODO: setup, interact, teardown
19+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package actions
5+
6+
import (
7+
"context"
8+
"log"
9+
aws_servicediscovery "github.com/aws/aws-sdk-go-v2/service/servicediscovery"
10+
)
11+
12+
type CloudMapActions struct {
13+
Client *aws_servicediscovery.Client
14+
}
15+
16+
// TODO: Add action methods matching CLI tutorial

0 commit comments

Comments
 (0)