Skip to content

Commit

Permalink
Unpin Ubuntu Focal version by default
Browse files Browse the repository at this point in the history
  • Loading branch information
dagguh committed Jun 10, 2024
1 parent afdde11 commit e69afac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Dropping a requirement of a major version of a dependency is a new contract.
- Add `CanonicalAmiProvider.Builder.avoidUnattendedUpgrades` for bumping `imageName` to Focal or higher.

### Fixed
- Bump Ubuntu Focal AMI to `ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20240531`.
The previous one was 2 years old and disappeared: `ubuntu-focal-20.04-amd64-server-20220610`.
- Unpin Ubuntu Focal version in `CanonicalAmiProvider.Builder` by default.
You can still pin a specific release date, e.g. `imageName("ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20240531")`

## [1.15.0] - 2024-01-23
[1.15.0]: https://github.com/atlassian-labs/aws-resources/compare/release-1.14.0...release-1.15.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,10 @@ class CanonicalImageIdByNameResolver private constructor(
)
)
.images
.sortedByDescending { it.creationDate }
.map { it.imageId }
.let {
when {
it.isEmpty() -> throw Exception("Failed to find image $imageName in $region")
it.size > 1 -> throw Exception("More than one image found with name $imageName in declared region $region. Selecting any of them automatically could create a security risk, so we can't proceed")
else -> it.first()
}
}
.firstOrNull()
?: throw Exception("Failed to find image containing $imageName in $region")

class Builder(
private val ec2: AmazonEC2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CanonicalAmiProvider private constructor(
}

class Builder {
private val focal = "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20240531"
private val focal = "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server"
private var imageName = focal

/**
Expand Down

0 comments on commit e69afac

Please sign in to comment.