-
Notifications
You must be signed in to change notification settings - Fork 623
/
api_op_DetectStackSetDrift.go
171 lines (146 loc) · 5.96 KB
/
api_op_DetectStackSetDrift.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package cloudformation
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type DetectStackSetDriftInput struct {
_ struct{} `type:"structure"`
// The ID of the stack set operation.
OperationId *string `min:"1" type:"string" idempotencyToken:"true"`
// The user-specified preferences for how AWS CloudFormation performs a stack
// set operation.
//
// For more information on maximum concurrent accounts and failure tolerance,
// see Stack set operation options (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-ops-options).
OperationPreferences *StackSetOperationPreferences `type:"structure"`
// The name of the stack set on which to perform the drift detection operation.
//
// StackSetName is a required field
StackSetName *string `type:"string" required:"true"`
}
// String returns the string representation
func (s DetectStackSetDriftInput) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DetectStackSetDriftInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "DetectStackSetDriftInput"}
if s.OperationId != nil && len(*s.OperationId) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("OperationId", 1))
}
if s.StackSetName == nil {
invalidParams.Add(aws.NewErrParamRequired("StackSetName"))
}
if s.OperationPreferences != nil {
if err := s.OperationPreferences.Validate(); err != nil {
invalidParams.AddNested("OperationPreferences", err.(aws.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DetectStackSetDriftOutput struct {
_ struct{} `type:"structure"`
// The ID of the drift detection stack set operation.
//
// you can use this operation id with DescribeStackSetOperation to monitor the
// progress of the drift detection operation.
OperationId *string `min:"1" type:"string"`
}
// String returns the string representation
func (s DetectStackSetDriftOutput) String() string {
return awsutil.Prettify(s)
}
const opDetectStackSetDrift = "DetectStackSetDrift"
// DetectStackSetDriftRequest returns a request value for making API operation for
// AWS CloudFormation.
//
// Detect drift on a stack set. When CloudFormation performs drift detection
// on a stack set, it performs drift detection on the stack associated with
// each stack instance in the stack set. For more information, see How CloudFormation
// Performs Drift Detection on a Stack Set (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html).
//
// DetectStackSetDrift returns the OperationId of the stack set drift detection
// operation. Use this operation id with DescribeStackSetOperation to monitor
// the progress of the drift detection operation. The drift detection operation
// may take some time, depending on the number of stack instances included in
// the stack set, as well as the number of resources included in each stack.
//
// Once the operation has completed, use the following actions to return drift
// information:
//
// * Use DescribeStackSet to return detailed informaiton about the stack
// set, including detailed information about the last completed drift operation
// performed on the stack set. (Information about drift operations that are
// in progress is not included.)
//
// * Use ListStackInstances to return a list of stack instances belonging
// to the stack set, including the drift status and last drift time checked
// of each instance.
//
// * Use DescribeStackInstance to return detailed information about a specific
// stack instance, including its drift status and last drift time checked.
//
// For more information on performing a drift detection operation on a stack
// set, see Detecting Unmanaged Changes in Stack Sets (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html).
//
// You can only run a single drift detection operation on a given stack set
// at one time.
//
// To stop a drift detection stack set operation, use StopStackSetOperation .
//
// // Example sending a request using DetectStackSetDriftRequest.
// req := client.DetectStackSetDriftRequest(params)
// resp, err := req.Send(context.TODO())
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DetectStackSetDrift
func (c *Client) DetectStackSetDriftRequest(input *DetectStackSetDriftInput) DetectStackSetDriftRequest {
op := &aws.Operation{
Name: opDetectStackSetDrift,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DetectStackSetDriftInput{}
}
req := c.newRequest(op, input, &DetectStackSetDriftOutput{})
return DetectStackSetDriftRequest{Request: req, Input: input, Copy: c.DetectStackSetDriftRequest}
}
// DetectStackSetDriftRequest is the request type for the
// DetectStackSetDrift API operation.
type DetectStackSetDriftRequest struct {
*aws.Request
Input *DetectStackSetDriftInput
Copy func(*DetectStackSetDriftInput) DetectStackSetDriftRequest
}
// Send marshals and sends the DetectStackSetDrift API request.
func (r DetectStackSetDriftRequest) Send(ctx context.Context) (*DetectStackSetDriftResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &DetectStackSetDriftResponse{
DetectStackSetDriftOutput: r.Request.Data.(*DetectStackSetDriftOutput),
response: &aws.Response{Request: r.Request},
}
return resp, nil
}
// DetectStackSetDriftResponse is the response type for the
// DetectStackSetDrift API operation.
type DetectStackSetDriftResponse struct {
*DetectStackSetDriftOutput
response *aws.Response
}
// SDKResponseMetdata returns the response metadata for the
// DetectStackSetDrift request.
func (r *DetectStackSetDriftResponse) SDKResponseMetdata() *aws.Response {
return r.response
}