mirror of https://github.com/kubernetes/kops.git
Add missing instance monitoring for CF and TF
This commit is contained in:
parent
51e70083f8
commit
b5e4b7ad48
|
@ -395,6 +395,9 @@
|
|||
},
|
||||
"ImageId": "ami-12345678",
|
||||
"InstanceType": "t2.medium",
|
||||
"Monitoring": {
|
||||
"Enabled": true
|
||||
},
|
||||
"NetworkInterfaces": [
|
||||
{
|
||||
"AssociatePublicIpAddress": true,
|
||||
|
|
|
@ -371,6 +371,9 @@ resource "aws_launch_template" "nodes-complex-example-com" {
|
|||
lifecycle {
|
||||
create_before_destroy = true
|
||||
}
|
||||
monitoring {
|
||||
enabled = true
|
||||
}
|
||||
name_prefix = "nodes.complex.example.com-"
|
||||
network_interfaces {
|
||||
associate_public_ip_address = true
|
||||
|
|
|
@ -411,6 +411,9 @@ resource "aws_launch_template" "nodes-externalpolicies-example-com" {
|
|||
lifecycle {
|
||||
create_before_destroy = true
|
||||
}
|
||||
monitoring {
|
||||
enabled = true
|
||||
}
|
||||
name_prefix = "nodes.externalpolicies.example.com-"
|
||||
network_interfaces {
|
||||
associate_public_ip_address = true
|
||||
|
|
|
@ -206,6 +206,11 @@ func (t *LaunchTemplate) RenderCloudformation(target *cloudformation.Cloudformat
|
|||
if e.Tenancy != nil {
|
||||
data.Placement = []*cloudformationLaunchTemplatePlacement{{Tenancy: e.Tenancy}}
|
||||
}
|
||||
if e.InstanceMonitoring != nil {
|
||||
data.Monitoring = &cloudformationLaunchTemplateMonitoring{
|
||||
Enabled: e.InstanceMonitoring,
|
||||
}
|
||||
}
|
||||
if e.IAMInstanceProfile != nil {
|
||||
data.IAMInstanceProfile = &cloudformationLaunchTemplateIAMProfile{
|
||||
Name: e.IAMInstanceProfile.CloudformationLink(),
|
||||
|
|
|
@ -72,6 +72,9 @@ func TestLaunchTemplateCloudformationRender(t *testing.T) {
|
|||
"MaxPrice": "10"
|
||||
}
|
||||
},
|
||||
"Monitoring": {
|
||||
"Enabled": true
|
||||
},
|
||||
"NetworkInterfaces": [
|
||||
{
|
||||
"AssociatePublicIpAddress": true,
|
||||
|
@ -155,6 +158,9 @@ func TestLaunchTemplateCloudformationRender(t *testing.T) {
|
|||
},
|
||||
"InstanceType": "t2.medium",
|
||||
"KeyName": "mykey",
|
||||
"Monitoring": {
|
||||
"Enabled": true
|
||||
},
|
||||
"NetworkInterfaces": [
|
||||
{
|
||||
"AssociatePublicIpAddress": true,
|
||||
|
|
|
@ -205,6 +205,11 @@ func (t *LaunchTemplate) RenderTerraform(target *terraform.TerraformTarget, a, e
|
|||
if e.Tenancy != nil {
|
||||
tf.Placement = []*terraformLaunchTemplatePlacement{{Tenancy: e.Tenancy}}
|
||||
}
|
||||
if e.InstanceMonitoring != nil {
|
||||
tf.Monitoring = []*terraformLaunchTemplateMonitoring{
|
||||
{Enabled: e.InstanceMonitoring},
|
||||
}
|
||||
}
|
||||
if e.IAMInstanceProfile != nil {
|
||||
tf.IAMInstanceProfile = []*terraformLaunchTemplateIAMProfile{
|
||||
{Name: e.IAMInstanceProfile.TerraformLink()},
|
||||
|
|
|
@ -72,6 +72,9 @@ resource "aws_launch_template" "test" {
|
|||
lifecycle {
|
||||
create_before_destroy = true
|
||||
}
|
||||
monitoring {
|
||||
enabled = true
|
||||
}
|
||||
name_prefix = "test-"
|
||||
network_interfaces {
|
||||
associate_public_ip_address = true
|
||||
|
@ -148,6 +151,9 @@ resource "aws_launch_template" "test" {
|
|||
lifecycle {
|
||||
create_before_destroy = true
|
||||
}
|
||||
monitoring {
|
||||
enabled = true
|
||||
}
|
||||
name_prefix = "test-"
|
||||
network_interfaces {
|
||||
associate_public_ip_address = true
|
||||
|
|
Loading…
Reference in New Issue