-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource/aws_lb_listener_certificate: Add import support (#16474)
Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAwsLbListenerCertificate_disappears (170.83s) --- PASS: TestAccAwsLbListenerCertificate_basic (176.25s) --- PASS: TestAccAwsLbListenerCertificate_multiple (234.15s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAwsLbListenerCertificate_disappears (155.87s) --- PASS: TestAccAwsLbListenerCertificate_basic (159.04s) --- PASS: TestAccAwsLbListenerCertificate_multiple (251.86s) ```
- Loading branch information
Showing
5 changed files
with
110 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:enhancement | ||
resource/aws_lb_listener_certificate: Add import support | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package elbv2 | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
) | ||
|
||
const listenerCertificateIDSeparator = "_" | ||
|
||
func ListenerCertificateParseID(id string) (string, string, error) { | ||
parts := strings.Split(id, listenerCertificateIDSeparator) | ||
if len(parts) == 2 && parts[0] != "" && parts[1] != "" { | ||
return parts[0], parts[1], nil | ||
} | ||
|
||
return "", "", | ||
fmt.Errorf("unexpected format for ID (%q), expected listener-arn"+listenerCertificateIDSeparator+ | ||
"certificate-arn", id) | ||
} | ||
|
||
func ListenerCertificateCreateID(listenerArn, certificateArn string) string { | ||
return strings.Join([]string{listenerArn, listenerCertificateIDSeparator, certificateArn}, "") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters