resources: aws: ec2: Check that policy.Statement != nil
This commit is contained in:
committed by
James Shubin
parent
9ba9ef1cbf
commit
388a08e13a
@@ -1155,6 +1155,10 @@ func (obj *AwsEc2Res) snsAuthorizeCloudWatch(topicArn string) error {
|
||||
if err := json.Unmarshal([]byte(*pol), &policy); err != nil {
|
||||
return err
|
||||
}
|
||||
// make sure the existing policy statement(s) are returned
|
||||
if policy.Statement == nil {
|
||||
return fmt.Errorf("sns policy statement is nil")
|
||||
}
|
||||
// construct a policy statement
|
||||
permission := snsStatement{
|
||||
Sid: SnsPolicySid,
|
||||
|
||||
Reference in New Issue
Block a user