Skip to content

Commit

Permalink
Merge pull request #24278 from disconnect3d/patch-1
Browse files Browse the repository at this point in the history
Fix a subtle bug with beanstalkCnamePrefixRegexp
  • Loading branch information
ewbankkit authored Apr 18, 2022
2 parents 267aca0 + 4f8a43b commit 2b21054
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/24278.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_elastic_beanstalk_environment: Correctly set `cname_prefix` attribute
```
2 changes: 1 addition & 1 deletion internal/service/elasticbeanstalk/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ func resourceEnvironmentRead(d *schema.ResourceData, meta interface{}) error {
}

if env.CNAME != nil {
beanstalkCnamePrefixRegexp := regexp.MustCompile(`(^[^.]+)(.\w{2}-\w{4,9}-\d)?.(elasticbeanstalk.com|eb.amazonaws.com.cn)$`)
beanstalkCnamePrefixRegexp := regexp.MustCompile(`(^[^.]+)(.\w{2}-\w{4,9}-\d)?\.(elasticbeanstalk\.com|eb\.amazonaws\.com\.cn)$`)
var cnamePrefix string
cnamePrefixMatch := beanstalkCnamePrefixRegexp.FindStringSubmatch(*env.CNAME)

Expand Down

0 comments on commit 2b21054

Please sign in to comment.