mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
provider/aws: Update refresh state func target for DHCP options
This commit is contained in:
parent
e865c342cc
commit
48ecc9b3a0
@ -121,8 +121,8 @@ func resourceAwsVpcDhcpOptionsCreate(d *schema.ResourceData, meta interface{}) e
|
|||||||
log.Printf("[DEBUG] Waiting for DHCP Options (%s) to become available", d.Id())
|
log.Printf("[DEBUG] Waiting for DHCP Options (%s) to become available", d.Id())
|
||||||
stateConf := &resource.StateChangeConf{
|
stateConf := &resource.StateChangeConf{
|
||||||
Pending: []string{"pending"},
|
Pending: []string{"pending"},
|
||||||
Target: []string{},
|
Target: []string{"created"},
|
||||||
Refresh: DHCPOptionsStateRefreshFunc(conn, d.Id()),
|
Refresh: resourceDHCPOptionsStateRefreshFunc(conn, d.Id()),
|
||||||
Timeout: 1 * time.Minute,
|
Timeout: 1 * time.Minute,
|
||||||
}
|
}
|
||||||
if _, err := stateConf.WaitForState(); err != nil {
|
if _, err := stateConf.WaitForState(); err != nil {
|
||||||
@ -249,7 +249,7 @@ func findVPCsByDHCPOptionsID(conn *ec2.EC2, id string) ([]*ec2.Vpc, error) {
|
|||||||
return resp.Vpcs, nil
|
return resp.Vpcs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func DHCPOptionsStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc {
|
func resourceDHCPOptionsStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc {
|
||||||
return func() (interface{}, string, error) {
|
return func() (interface{}, string, error) {
|
||||||
DescribeDhcpOpts := &ec2.DescribeDhcpOptionsInput{
|
DescribeDhcpOpts := &ec2.DescribeDhcpOptionsInput{
|
||||||
DhcpOptionsIds: []*string{
|
DhcpOptionsIds: []*string{
|
||||||
@ -274,6 +274,6 @@ func DHCPOptionsStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefresh
|
|||||||
}
|
}
|
||||||
|
|
||||||
dos := resp.DhcpOptions[0]
|
dos := resp.DhcpOptions[0]
|
||||||
return dos, "", nil
|
return dos, "created", nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user