forked from kyma-project/control-plane
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provisioner: add support for configuring AWS IMDSv2 access method (ky…
…ma-project#3429) * provisioner: add support for configuring AWS IMDSv2 access method * address comments
- Loading branch information
Showing
13 changed files
with
239 additions
and
42 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
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
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
34 changes: 34 additions & 0 deletions
34
components/provisioner/internal/model/infrastructure/aws/worker.go
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,34 @@ | ||
package aws | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// WorkerConfig contains configuration settings for the worker nodes. | ||
type WorkerConfig struct { | ||
metav1.TypeMeta `json:",inline"` | ||
|
||
// InstanceMetadataOptions contains configuration for controlling access to the metadata API. | ||
InstanceMetadataOptions *InstanceMetadataOptions `json:"instanceMetadataOptions,omitempty"` | ||
} | ||
|
||
// HTTPTokensValue is a constant for HTTPTokens values. | ||
type HTTPTokensValue string | ||
|
||
var ( | ||
// HTTPTokensRequired is a constant for requiring the use of tokens to access IMDS. Effectively disables access via | ||
// the IMDSv1 endpoints. | ||
HTTPTokensRequired HTTPTokensValue = "required" | ||
// HTTPTokensOptional that makes the use of tokens for IMDS optional. Effectively allows access via both IMDSv1 and | ||
// IMDSv2 endpoints. | ||
HTTPTokensOptional HTTPTokensValue = "optional" | ||
) | ||
|
||
// InstanceMetadataOptions contains configuration for controlling access to the metadata API. | ||
type InstanceMetadataOptions struct { | ||
// HTTPTokens enforces the use of metadata v2 API. | ||
HTTPTokens *HTTPTokensValue `json:"httpTokens,omitempty"` | ||
// HTTPPutResponseHopLimit is the response hop limit for instance metadata requests. | ||
// Valid values are between 1 and 64. | ||
HTTPPutResponseHopLimit *int64 `json:"httpPutResponseHopLimit,omitempty"` | ||
} |
Oops, something went wrong.